Here’s an interesting post from Mark C. Chu-Carroll on one area where C and C++ compilers don’t do so well: alias detection. He notes a case where interpreted OCaml is faster than compiled C (and even faster when the OCaml is fully compiled). Why? Well, due to language syntax, the OCaml environment can easily tell that two array references must be completely distinct, whereas the C compiler cannot. The OCaml environment can make certain optimizations and parallelizations which are only possible when two or more references in the algorithm must be known to not interact. Read the full article for details.
Just another example that one person’s benchmark won’t tell you how fast your app will run.