Lush, OCaml and more, part deux

In a previous blog entry, I did some extremely informal benchmarking with Lush, OCaml, Python and C. I’ve now added two new Python tests: one with Psyco, a JIT-like solution that takes almost no effort to add to existing code, and one with Pyrex, where one can code extension modules in a language that looks just like Python but has types. These modules are then translated to C and compiled into Python usable extension libaries.

With Psyco, one only has to add the lines “import psyco; psyco.full()” to one’s Python code. The performance gains can be huge, but in general are quite modest. It takes far less effort than Pyrex though.

The updated benchmarks table is shown below:

LanguageTime (seconds)
Octave 2.1.577.894
Python 2.3.40.459
OCaml 3.08 interpreted0.229
Python 2.3.5 with Psyco0.148
Python 2.3.5 with Pyrex0.064
OCaml 3.08 compiled0.021
gcc 3.3.40.017

The new implementations are available at the usual place.