Python execution speed

Morten W. Petersen morten at thingamy.net
Mon Nov 19 19:28:00 EST 2001


Hello,

I started a thread [1] about a week ago, asking about benefits of moving
from Python to Common Lisp.

I've done some more research and 'heard' that Lisp can be up to 80% of the
speed of programs written in C (compiling the Lisp code).

Seeing a thread [2] from July this year on the python mailing list there's 
some discussion about a 'Python compiler' [3] (a module named psyco that 
can compile python code and make it 'twice as fast'):

>>> import _psyco
>>> def f():
...     for x in range(100000): pass
...
>>> ff = _psyco.proxy(f)
>>> import time
>>> a = time.time(); f(); b = time.time() - a
>>> a, b
(1006220953.2038749, 0.05778205394744873)
>>> a = time.time(); ff(); b = time.time() - a
[snip debugging output]
>>> a, b
(1006220965.896633, 0.03587496280670166)

..which seems to hold true (although in this example the execution is 1.61
times faster).

Guido responded with great enthusiasm [4] and mentioned sending in a paper
for the next python conference..

..now, what I'm wondering about is:

  1. What is the plan for psyco (inclusion in the standard distribution, etc) ?
  2. Will there be a JIT compiler for Python ?
  3. Are there any similar efforts for Jython [5] ?
  4. Are efforts made to optimize Python's execution speed in general ?

[1] http://groups.google.com/groups?hl=en&threadm=7xlmhddlr3.fsf%40ruckus.brouhaha.com&rnum=1&prev=/groups%3Fq%3Dbenefits%2Bof%2Bmoving%2Bfrom%2Bpython%26hl%3Dno%26btnG%3DGoogle-s%25F8k%26meta%3D
[2] http://mail.python.org/pipermail/python-dev/2001-June/015503.html
[3] http://homepages.ulb.ac.be/~arigo/psyco/
[4] http://mail.python.org/pipermail/python-dev/2001-June/015525.html
[5] http://www.jython.org/docs/whatis.html

Regards,

Morten




More information about the Python-list mailing list