Re: speed with python

Guido.van.Rossum@cwi.nl
Thu, 06 Jan 1994 18:51:35 +0100

> I've just finished two rudimentary speed tests with Python, comparing
> Python 0.9.9 and Python 0.9.6. It seems the more recent version of
> Python is running at about 70-80% of the speed of the older version.
>
> Questions:
> - has anyone else noticed this?
> - are these figures about the same for version 1.0?
> - is there anything I can do (say, in configuring Python)
> to recover some or all of the performance of 0.9.6?

There have been some generalizations in 0.9.9 that slowed things down,
in particular dictionaries are somewhat slower now that they support
more than strings as arguments. As a compensation, I've made local
variables faster by not going through a dictionary at all for them (in
most cases anyway), but this may not be enough.

In 1.0.0, there are some new optimizations (e.g. small integers and
short strings are cached), but it remains to be seen how this affects
performance -- in all honestly, I've been too busy getting
functionality right and bugs out that I haven't really checked raw
performance... Why don't you fetch 1.0.0 beta 5 and test it out?
You may also try to measaure the effect of various optimization
parameters. Check out the #if statements in intobject.c,
stringobject.c, tupleobject.c and mappingobject.c. (Anything else I've
forgotten, Sjoerd?)

--Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
URL: <http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>