Quote:
Originally Posted by cipri
|
Note that in that 'benchmark', the variable x is not used. Any C++ optimizer would remove the assignment, then remove the expression because it isn't used, then remove all the loops because their indices aren't used, leaving the null program. No surprise that doing nothing is a lot faster than doing anything.
If you want to do such a port, go for it. However, better would be to do as Kovid suggested: find bottlenecks and either report or (preferable) fix them. Some users have done similar things and helped improve performance by large factors. The latest one was demonstrating that file system performance on some systems is terrible, and that huge benefits could be obtained by caching results of the cover existence test (a file_exists test) in the DB.