[Python-Dev] Tuning Python dicts

Terry Reedy tjreedy at udel.edu
Sun Apr 11 03:19:43 CEST 2010


>> I may be missing the point, but ISTM that the assumption of this
>> approach is that there are often collisions in the hash table. I think
>> that assumption is false; at least, I recommend to validate that
>> assumption before proceeding.
>
> It's just an experiment for a class, not something I am (yet)
> seriously thinking about contributing back to CPython.  I think my
> chances of improving over the current implementation are slim.  I do
> not have that much hubris.  :)  I would just rather do experimental
> rather than theoretical work with data structures.
>
> I think you're right about the number of collisions, though.  CPython
> dicts use a pretty low load factor (2/3) to keep collision counts
> down.

There was a paper discussing Python dicts at PyCon 2010. I believe it 
included some data on collisions. I posted the link on Python list a 
couple of weeks ago.

Terry Jan Reedy



More information about the Python-Dev mailing list