[Python-Dev] iterzip()
Guido van Rossum
guido@python.org
Mon, 29 Apr 2002 17:07:23 -0400
> A fixed threshold of any size will leave us vulnerable to
> quadratic-time cases. Proportional growth wouldn't, though. For
> example, if a round of gc didn't find anything to collect, or found
> very little, we could boost the threshold by 25% (that's a right
> shift by 2 and an add <wink>). Contrarily, when gc finds lots of
> stuff to collect, reduce the threshold. This adjusts itself to a
> program's runtime characteristics. I suspect most long-running
> programs enjoy vast stretches of time over which the second
> derivative of their gc behavior is relatively constant <wink>.
Should we worry about programs that don't create any cyclical garbage
for a long time, and then sudenly start creating lots of it? The
initial GC-free period may bump the threshold up very far, and then it
will build up a significant pile of cyclical garbage before GC runs
again.
--Guido van Rossum (home page: http://www.python.org/~guido/)