Python dictionary size/entry limit?

Stefan Behnel stefan_ml at behnel.de
Sun Feb 22 14:21:51 EST 2009


intelliminer at gmail.com wrote:
> Ummm, I didn't know about the dbm databases. It seems there are many
> different
> modules for this kind of tasks: gdbm, berkeley db, cdb, etc. I'm
> needing to implement
> a constant hashtable with a large number of keys, but only a small
> fraction of them
> will be accessed frequently, the read speed is crucial. It would be
> ideal if
> the implementation caches all the frequently used key/value pairs in
> memory. Which
> module should I use? And is there a way to specify the amount of
> memory it uses for caching?
> BTW, the target platform is Linux.

Their interfaces are mostly compatible to Python dicts. Just keep your code
independent at the beginning and benchmark it against all of them.

Stefan



More information about the Python-list mailing list