[Python-Dev] PyBench DictCreation (was Re: Performance compares)

M.-A. Lemburg mal@lemburg.com
Fri, 18 May 2001 13:36:28 +0200


Tim Peters wrote:
> 
> [MAL]
> > FYI, I have a patch which inlines small dictionaries directly
> > into the type object
> 
> You don't mean that, but how about uploading the patch to SF anyway?  Assign
> it to me and I'll dig into it.

Right, I meant the dict object... (the "not enough coffee" thingie
again ;-)
 
> > ...
> > I've experimented with the minimal size a lot and found that
> > setting it to 8 slots gives the bext performance/memory tradeoff.
> 
> Having done just a couple rounds of instrumented runs across various apps, I
> was moving to that conclusion too.  Also that "small" dicts are so common
> that avoiding the "extra" malloc would be a nice win for them, and that large
> dicts are rare enough and resizing expensive enough anyway that the new cost
> of doing a two-headed allocation strategy would be lost in the noise.  IOW,
> I'm inclined to believe that everything you say your patch does is Good For
> Python, and Guido is so sympathetic to my lack of sleep lately that I bet
> he'll let me slip in one uglification without scowling <wink>.

I'll see if I find time today to rework the patch for Python CVS.
The patch is hiding in my old Python 1.5 killer patch ;-) -- which
gives more than a 50% boost on my machine, but that's another
story.

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Company & Consulting:                           http://www.egenix.com/
Python Software:                        http://www.lemburg.com/python/