Tremendous slowdown due to garbage collection

John Nagle nagle at animats.com
Mon Apr 28 14:41:41 EDT 2008


Dieter Maurer wrote:
> Christian Heimes <lists at cheimes.de> writes on Sat, 12 Apr 2008 18:47:32 +0200:
>> andreas.eisele at gmail.com schrieb:
>>> which made me suggest to use these as defaults, but then

> We observed similar very bad behaviour -- in a Web application server.
> Apparently, the standard behaviour is far from optimal when the
> system contains a large number of objects and occationally, large
> numbers of objects are created in a short time.
> We have seen such behaviour during parsing of larger XML documents, for
> example (in our Web application).

    Our solution to that was to modify BeautifulSoup to use weak pointers.
All the pointers towards the root and towards previous parts of the
document are "weak".  As a result, reference counting alone is sufficient
to manage the tree.  We still keep GC enabled, but it doesn't find much
to collect.

					John Nagle
					SiteTruth



More information about the Python-list mailing list