[Python-Dev] patch: speed up name access by up to 80%

Neal Norwitz neal@metaslash.com
Mon, 11 Feb 2002 17:26:01 -0500


Oren Tirosh wrote:
> 
> Problem: Python name lookup in dictionaries is relatively slow.

> http://www.tothink.com/python/fastnames/fastnames.patch

I tried this patch (*) by running the regression tests:

	make && time ./python -E -tt Lib/test/regrtest.py

All the expected tests passed and there were no failures, this is good.
The bad news is that it was slower.  It took 42 user seconds longer 
with the patch than without.

Before patch:

    real    3m1.031s
    user    1m19.480s
    sys     0m2.400s

After patch:

    real    3m38.071s
    user    1m51.760s
    sys     0m2.790s

The box is Linux 2.4, Athlon 650, 256 MB.

(*) Pretty sure this was patch #1, running sum yields:  53200 10.
But it shouldn't matter, since it was only a name change, right?

Neal