writing large dictionaries to file using cPickle

python at bdurham.com python at bdurham.com
Wed Jan 28 11:32:27 EST 2009


Hi,

Change:

pickle.dump(mydict, pfile)

to:

pickle.dump(mydict, pfile, -1 )

I think you will see a big difference in performance and also a much
smaller file on disk.

BTW: What type of application are you developing that creates so many
dictionaries? Sounds interesting.

Malcolm



More information about the Python-list mailing list