pickle performance on larger objects

François Pinard pinard at iro.umontreal.ca
Thu Jul 18 06:59:23 EDT 2002


[Sam Penrose]

> For my particular use case cPickle is still several (many ?) times slower
> than just recreating the object by reading in a file.  What implications
> this has for best practices in persistence of larger objects I do not
> know, but I hope the data point is of interest to others.

It also corresponds to what I saw while rewriting `rebox.el' into `rebox.py'.
`rebox.py' refills boxed comments in various programming languages, I
made it to produce a bigger example for Pymacs, and also to make `rebox'
itself more maintainable: I find Python easier to maintain than Lisp.

When used in batch to rebox a single comment, `rebox.py' spends almost
all of its time in initialisation, and I thought I could make it more
speedy by initialising once and saving the result into a pickle, meant to
be reloaded in later runs.  Pickle loading was not significantly faster
than re-initialising afresh, so I dropped it to favour simplicity.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard






More information about the Python-list mailing list