anydbm is slow

Sean Reifschneider jafo-pythonlist at tummy.com
Thu Jan 3 10:07:45 EST 2002


On Wed, Jan 02, 2002 at 11:19:24AM +1100, Amir Michail wrote:
>It returns dbhash from '/usr/lib/python2.1/dbhash.pyc'.
>
>Perhaps I should use a different db package?  The data consists
>of an enormous number of keys and relatively short data strings.

I used anydbm for radiusContext and in general it worked pretty well.
I didn't consider it very slow, and it's not unusual for it to be dealing
with several hundred megabytes to over 1GB of data.  It stores a fair bit
of payload for every key, though.

One thing I did find was that letting anydbm pick the dbm module, which
I eventually found would, after inserting a lot of elements, generate an
exception on insertion.  It, unfortunately, wasn't very reliable and I
never ended up tracking it down.  I did end up switching to gdbm, which
solved the problem.

You can see what I did by looking at the code for a recent radiusContext at
ftp://ftp.tummy.com/pub/tummy/radiusContext/

Sean
-- 
 The day that Linux invades the desktop market is the day that I start
 believing in people again.
Sean Reifschneider, Inimitably Superfluous <jafo at tummy.com>
tummy.com - Linux Consulting since 1995. Qmail, KRUD, Firewalls, Python




More information about the Python-list mailing list