Subject: Re: Exponential time increase in garbage collection

Sean McGrath sean.mcgrath at propylon.com
Sun May 19 07:30:32 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

[Martin van Loewis]
 >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.

The objects do indeed contain dictionaries but there are no manual
deletions, __del__ overrides or anything of that nature. The delete
is performed "naturally" by Python.

regards,
Sean






More information about the Python-list mailing list