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

Tim Peters tim@digicool.com
Fri, 18 May 2001 04:32:39 -0400


[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.

> ...
> 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>.