Home

September 22nd, 2006

05:29 pm
compare python vs lua, ruby, PHP and Haskell

I like the comparison Erik Wrenholt has made. Via a simple fractal program, you can evaluate the pure performance of different programs.

Since it's a bit outdated, I've re-execute it with last version of Python, Lua, Ruby, PHP and Haskell:
  • Haskell ghc-6.4.2: 2sec
  • PHP-5.1.6: 2.48sec*
  • Python-2.4.3: 2.65sec
  • Python-2.5: 2.78sec
  • Lua-5.1: 3.4sec**
  • Ruby-1.8.5: 10.18sec
* I'm using microtime() instead of time()
**I'm using os.clock() instead of os.time()

All those tests was done 5x on a Windows XP(Hurrgg sorry) machine with a 2-GHz Pentium M 760 and 1GB of RAM

UPDATE:

Based on a comment about psyco, here the result of the the script simply by adding:
import psyco
psyco.full()
at the top the script.
  • python-2.4 + psyco 1.5.1: 0.37sec!!!

Same machine, same configuration, same methodology to make the test