Extremely Contrived GCC vs V8 Benchmark

On Hacker News today, someone posted a link to an extremely contrived benchmark in which it was claimed that the V8 Javascript compiler was faster than GCC. This was true, in the very narrow case where GCC was prevented from optimizing properly while V8 was run in ideal conditions, and in which the benchmark was compile time plus run time rather than run time alone.

I wouldn’t post this, except that I’ve been reading a lot about benchmarking recently and this is an excellent example of how to do it completely wrong. Brennan at comment 12 on the original post sums it up:


What you’ve just written is one of the most contrived benchmarks I
have ever read. At no point in your rambling, incoherent argument were
you even close to anything that could be considered an objective
comparison. Everyone in this room is now dumber for having read it. I
award you no points, and may God have mercy on your soul.
Questions, comments, interesting anecdotes? Tweet to me at @ajdecon, or send me an email at ajdecon@ajdecon.org.