Dictionary in Python

Hrvoje Niksic hniksic at iskon.hr
Tue Mar 14 09:24:51 CET 2000

Alex <alex at somewhere.round.here> writes:

> > Does anyone know how dictionary is implemented in Python(such as hash
> > table, heap, linked list)? If my dictionary increases in size, how
> > much is the impact on performace?
> Based on discussions I've seen in the newsgroup, I'm pretty sure
> it's a hash table.  My experience has been that I can stick about
> 1.5 million string keys in a dictionary before collisions start to
> hurt me.

Maybe your problem are not collisions, but cache misses.

> I would love it if there was a way to increase the size of the hash
> table.  I'm sure I have more than enough memory for an order-of-
> magnitude increase.

AFAIK Python dictionaries increase dynamically.

More information about the Python-list mailing list