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:

<th>
  Time (seconds)
</th>
<td>
  7.894
</td>
<td>
  0.459
</td>
<td>
  0.229
</td>
<td>
  0.148
</td>
<td>
  0.064
</td>
<td>
  0.021
</td>
<td>
  0.017
</td>
Language
Octave 2.1.57
Python 2.3.4
OCaml 3.08 interpreted
Python 2.3.5 with Psyco
Python 2.3.5 with Pyrex
OCaml 3.08 compiled
gcc 3.3.4

The new implementations are available at the usual place.