slow gdbm performance (doesn't honor "f" flag?)

Roy Smith roy at panix.com
Wed Apr 17 12:06:48 EDT 2002


I'm building a bunch of gdbm files with a fairly large amount of data.
The original text file is about 17 Mbytes which ends up being
about 50,000 gdbm records.  I'm using RedHat 6.2, and Python 2.1.2.

I open the gdbm files with:

db = gdbm.open (fileName, 'nf')

My understanding of the 'f' flag is that it would do everything in
memory and only flush data out to the disk when I did a close() or
sync(), but it doesn't seem to work that way.  My application takes
about 5 minutes to run, during which time the gdbm files keep getting
updated, and vmstat shows mostly idle CPU and lots of disk writes.

Is the gdbm module ignoring the 'f' flag, or does it just not work
quite the way I envisioned, or am I simply doing something wrong? :-)



More information about the Python-list mailing list