python optimization

David Wilson at
Thu Sep 15 15:13:37 CEST 2005

For the most part, CPython performs few optimisations by itself. You
may be interested in psyco, which performs several heavy optimisations
on running Python code.

Defining a function inside a loop in CPython will cause a new function
object to be created each and every time the loop runs. No such
automatic optimisation is performed there. For the most part, this lack
of opimisation not only simplifies the CPython implementation, but also
causes code to act much more closely to how it was defined, which is
good for new and advanced users alike.

Other than psyco, IronPython and PyPy are two projects which you might
be interested in if execution performance is of interest to you.


More information about the Python-list mailing list