[Python-Dev] Idle speed freak looking for trouble?

Fredrik Lundh fredrik@pythonware.com
Sat, 27 Oct 2001 22:45:36 +0200


tim wrote:


> SF bug 474992 contains a simple benchmark claimed to show dramatic slowdown
> from 1.5.2 to 2.0, and again but less so from 2.0 to 2.1.

fwiw, here's the timings I get on a slow windows box (using
PythonWare builds, and time.clock() instead of os.times()):

python 1.5: 2.01
python 2.0: 3.02
python 2.1: 3.00
python 2.2: 3.04

after playing some more, I ended up with this little benchmark:

def dosomething(item):
    return [None, None, None]

data = [None] * 100000

import time
t1 = time.clock();
x = map(dosomething, data)
t2 = time.clock()
print t2 - t1

python 1.5: 1.02 seconds
python 2.0: 1.95 seconds
python 2.1: 1.85 seconds
python 2.2: 1.90 seconds

</F>