[issue13903] New shared-keys dictionary implementation

Jim Jewett report at bugs.python.org
Fri Mar 9 18:30:28 CET 2012


Jim Jewett <jimjjewett at gmail.com> added the comment:

On Fri, Mar 9, 2012 at 12:13 PM, Jim Jewett

> So to get beneath 2/3 without lots of reallocation
> probably requires knowing when the key set is likely
> to be complete, and that is indeed more complex than
> the current changes.  (That said, you have left code
> in for immutable keys, so there may be cases where
> this isn't so hard after all.)

On second thought, avoiding reallocation doesn't have
to be perfect -- just good enough to work on average.

For a *normal* class, the keyset won't change after
the first instance has completed its __init__.

Which of course again leads to autoslots and a
normally NULL extra_dict.  And having done that,
it makes sense to combine the (normal) instance
dict with the type dict to simplify the lookup chain,
but ... that is probably too aggressive for the 3.3
schedule.  One silver lining to your patch plus hash
randomization is that that 3.4 should have a
pretty free hand with regards to internal details.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13903>
_______________________________________


More information about the Python-bugs-list mailing list