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:
|OCaml 3.08 interpreted||0.229|
|Python 2.3.5 with Psyco||0.148|
|Python 2.3.5 with Pyrex||0.064|
|OCaml 3.08 compiled||0.021|
The new implementations are available at the usual place.