IronPython vs CPython: faster in 1.6 times?

Christian Heimes lists at cheimes.de
Tue Feb 5 18:57:15 EST 2008


Luis M. González wrote:
> The result is that it runs slighty faster in both, IP and CP, but
> cpython is still faster (around 2x) than ironpython.
> However, when using psyco simply blows everything out of the water...

CPython is very fast here because it keeps blocks of allocated integer
objects to reduce the memory overhead. Your test shows that Python
highly specialized and optimized memory management for ints is superior
over IronPython's more general memory management. It also shows that
psyco optimized the function call. It's probably inlined.

You could replace foo(i) by i*i and see how much function calls affect
the speed.

Christian




More information about the Python-list mailing list