Quick Python version speed comparison

Python 2.6 beta 1 and 3.0 beta 1 were both released Wednesday. This gave me the urge to run a quick speed comparison on all the versions of Python installed on my Linux box.

The program in question is my solution to Project Euler problem 100. (Source code not provided, because that would be a spoiler.)

$ time python2.4 euler100.py > /dev/null

real 0m0.010s
user 0m0.006s
sys 0m0.005s

$ time python2.5 euler100.py > /dev/null

real 0m0.013s
user 0m0.010s
sys 0m0.003s

$ time python2.6 euler100.py > /dev/null

real 0m0.012s
user 0m0.009s
sys 0m0.003s

$ time python3.0 euler100.py > /dev/null

real 0m0.024s
user 0m0.021s
sys 0m0.004s

$ time pypy-c euler100.py > /dev/null
debug: WARNING: library path not found, using compiled-in sys.path

real 0m0.042s
user 0m0.009s
sys 0m0.033s

$ time jython euler100.py > /dev/null
Traceback (innermost last):
File "euler100.py", line 58, in ?
File "euler100.py", line 49, in main
OverflowError: float too large to convert

real 0m3.372s
user 0m2.707s
sys 0m0.092s

Executive summary: Python 2.4 through 2.6 are all about the same speed, for this test. 3.0 is about twice as slow. PyPy is four times as slow. And Jython is way slow and blows up converting big numbers.

Of course, this is just one data point. I should scale this test up to run all my Project Euler solutions that don't rely on external libraries. (It would probably take significant work to get libraries like gmpy to work with 3.0 or PyPy.)