[Python-Dev] lookdict

M.-A. Lemburg mal@lemburg.com
Fri, 01 Sep 2000 10:55:09 +0200

Vladimir Marangozov wrote:
> I'd like to request some clarifications on the recently checked
> dict patch. How it is supposed to work and why is this solution okay?
> What's the exact purpose of the 2nd string specialization patch?
> Besides that, I must say that now the interpreter is noticeably slower
> and MAL and I were warning you kindly about this code, which was
> fine tuned over the years. It is very sensible and was optimized to death.
> The patch that did make it was labeled "not ready" and I would have
> appreciated another round of review. Not that I disagree, but now I feel
> obliged to submit another patch to make some obvious perf improvements
> (at least), which simply duplicates work... Fred would have done them
> very well, but I haven't had the time to say much about the implementation
> because the laconic discussion on the Patch Manager went about
> functionality.
> Now I'd like to bring this on python-dev and see what exactly happened
> to lookdict and what the BeOpen team agreed on regarding this function.

Just for the record:

Python 1.5.2: 3050 pystones
Python 2.0b1: 2850 pystones before the lookup patch
              2900 pystones after the lookup patch
My old considerably patched Python 1.5:
              4000 pystones

I like Fred's idea about the customized and auto-configuring
lookup mechanism. This should definitely go into 2.1... perhaps
even with a hook that allows C extensions to drop in their own
implementations for certain types of dictionaries, e.g. ones
using perfect hash tables.

Marc-Andre Lemburg
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/