PyPy faster than C (on a carefully crafted example)
morepypy.blogspot.com
morepypy.blogspot.com
Sorry to sound like a language curmudgeon, but if you're going to make a claim that language x is faster than language y you're treading on thin ice. Languages in and of themselves don't have a whole lot of grounding in reality (especially Python; C has some closer analogues to the machine). That is to say that the devil is always in the details, or in this case the implementation of the compiler. Though my guess is the author of this blog post may not have intended for this small post to be flung across various nerd news sources to invoke the ire of language zealots everywhere.
The fact that the compiler can't inline across file boundaries (which is why PyPy is 'faster' in this case), I would think, is not a limitation of the C language, but rather a limitation of a C compiler (which I assume is GCC).
Has any work gone into inlining (probably only very simple) functions when linking against a shared library? Something like the "add" function clearly has no side effects if you were to look at the asm in the shared library, but it might be hard for the compiler to figure that out in any more complicated cases... perhaps by adding an annotation to the shared object file? It seems doable, at least.
1000000000.000000
real 0m4.396s user 0m4.386s sys 0m0.007s
and for gcc -O3 -flto -fwhole-program:
1000000000.000000
real 0m1.312s user 0m1.308s sys 0m0.003s"
Yet another case of somebody thinking they're making a clever comparison by forgetting to set their compiler flags properly.
Here is comparison of pypy and luajit http://shootout.alioth.debian.org/u32/benchmark.php?test=all...