Paul Rubin <http://[EMAIL PROTECTED]> writes:

> Michael Bacarella <[EMAIL PROTECTED]> writes:
>> If only it were so easy.
>
> I think I know what's going on, the dictionary updates are sending the
> GC into quadratic behavior.  Try turning off the GC:
>
>     import gc
>     gc.disable()

This is becoming an FAQ on this newsgroup, having come up first with
lists and now with dictionaries.  It can also be considered a serious
implementation problem, since code like Michael's is expected to
perform in (close to) linear time and in fact did so in previous
versions of Python, and still does in Perl and other popular scripting
languages.  Neither introductory nor intermediate Python learning
materials don't cover the need to disable GC when building large data
structures.

Maybe the default GC strategy should be rethought.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to