Tremendous slowdown due to garbage collection
lists at cheimes.de
Sat Apr 12 18:47:32 CEST 2008
andreas.eisele at gmail.com schrieb:
> which made me suggest to use these as defaults, but then
> Martin v. Löwis wrote that
>> No, the defaults are correct for typical applications.
> At that point I felt lost and as the general wish in that thread was
> to move
> discussion to comp.lang.python, I brought it up here, in a modified
> and simplified form.
Martin said that the default settings for the cyclic gc works for most
people. Your test case has found a pathologic corner case which is *not*
typical for common application but typical for an artificial benchmark.
Python is optimized for regular apps, not for benchmark (like some video
By the way you shouldn't use range for large ranges of more than a
thousand items. xrange() should be faster and it will definitely use
much less memory - and memory Python 2.5 and older will never release
again. I'm going to fix the issue for Python 2.6 and 3.0.
More information about the Python-list