PyPy gets faster
ripton.net
ripton.net
But I think next time I do this I'll increase the max runtime from 1 minute to 3. That will keep more of the slower programs in the benchmark, and make startup time count that much less. Without actually removing it, because that seems too artificial and contrived to me.
I'd like to see magnitude of the memory trade-off for using a JIT compiler. As a web developer my programs are mostly IO-bound, not CPU-bound. I'm also bootstrapping and trying to squeeze as much as I can out of my 512MB linode.
http://shootout.alioth.debian.org/u32/benchmark.php?test=all...
In short, if you care about the speed and LuaJit is an option, the choice is obvious.
http://shootout.alioth.debian.org/u32/benchmark.php?test=all...
Caveat - notice how many of those Lua programs were written by Mike Pall.
Some shootout programs look really hairy compared to normal code in their language. (The "optimized Haskell" shootout programs were, at one point, though I haven't followed it for a while.) With Lua / LuaJIT, that doesn't seem to be the case.
Besides, Mike Pall is using some of the shootout benchmarks to tune LuaJIT, so it's not surprising he has many of the top submissions.
Mike Pall is kind-of a good programmer, and that may well effect how the programs perform.
Tuning Lua code really isn't that hard, the language is tiny and has both semantics and performance characteristics that are easy to reason about accurately.
There's a good sample chapter from _Lua Programming Gems_ on Lua performance tuning (http://www.lua.org/gems/sample.pdf), FWIW. That and a good profiler will get you far.
PyPy is significant because of the nature of Python itself: the language specification is much more complex than Lua and there are currently many more users and applications.
[the more complicated the language specification, the harder it's going to be to prove things about, the harder it's going to be to write a compiler]
Well Mike Pall disagrees in that he says there are still a lot of possible optimizations. Also all the process of by hand optimization for specific architecture can theoretically be automatized and decoupled. You're totally right about Python complexity though.
Lisp implementations have been performing at a similar level for years now - many with the aid of AOT compilation, some not. Currently, Racket and SBCL are comparable to LuaJIT on the Alioth microbenchmarks - faster at some and slower at others.
But obviously for a proper comparison of the runtimes the benchmarks need to be implemented the 'same way' and not simply yield the 'same result'.
IronPython is at 2.6. PyPy and Jython are at 2.5. psyco is at 2.6.
Most of my Euler solvers are compatible with Python 2.5. The ones that don't work in 2.5 end up getting excluded from the benchmark, because the benchmark only shows programs that worked and finished in less than a minute on every tested Python.
Edit: Psycho also broke Python's semantics in a few very subtle ways, in that sense it isn't a truly fair comparison.
My viewpoint comes as someone who was very excited initially at the thought of a drop-in replacement for CPython whose goal was to be "faster than c". It's been a very long time and it seems like pypy still has a long way to go to achieve production-readiness, so it's hard to continue being excited about the project.
Being a drop-in replacement also includes things like virtual crashproofness, full stdlib support, runs major third-party packages flawlessly, etc.