Jeremy Hylton wrote: > > >>>>> "TP" == Tim Peters <tim@digicool.com> writes: > > TP> I've got no interest in trying to restore the old behavior. A > TP> compromise may be to boost the minimum size of a non-empty dict > TP> from 4 to 8. As is, the only non-empty dicts that can get away > TP> with using the current minimum size of 4 have no more than 2 > TP> elements. The question is whether such tiny non-empty dicts are > TP> common enough to make everyone else pay for "an extra" resize. > > I also did a profile run on CreateInstances, which has a difference of > +55.54% on my machine. It's basically the same story. The instance > dictionary is getting resized more often with Python 2.1+ than it did > with Python 1.5.2. I wouldn't be surprised if several more tests are > showing a slowdown with the same cause. > > So boosting the minimum size sounds like a good thing. FYI, I have a patch which inlines small dictionaries directly into the type object (rather than usin malloc to allocate the slot buffer). I've experimented with the minimal size a lot and found that setting it to 8 slots gives the bext performance/memory tradeoff. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Company & Consulting: http://www.egenix.com/ Python Software: http://www.lemburg.com/python/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4