Exponential time increase in garbage collection

Martin v. Loewis martin at v.loewis.de
Sun May 19 07:13:38 EDT 2002


Sean McGrath <sean.mcgrath at propylon.com> writes:

> I'm seeing curious figures (included below). Basically,
> Python 1.5.2 exhibits a big difference in deletion time for
> objects loaded via cPickle as opposed to pickle.py

My guess is that there is some large dictionary somewhere that is
cleared with a foolish algorithm such as

k = d.keys()
while k:
  del d[k[k]]
  del k[0]

I believe that this algorithm has performance characteristics similar
to the one you describe.

Regards,
Martin



More information about the Python-list mailing list