[Python-Dev] iterzip()

Jeremy Hylton jeremy@zope.com
Mon, 29 Apr 2002 16:25:34 -0400

>>>>> "NS" == Neil Schemenauer <nas@python.ca> writes:

  NS> Jeremy Hylton wrote:
  >> Note that there's a net excess of allocations in the storetup()
  >> case, so we invoke the garbage collector every n/700 times
  >> through the loop.

  NS> That's the dirty culprit. :-) With the GC disabled:

  NS>   justpush 0.81
  NS>    justzip 0.75

  NS> Perhaps we should raise the default threshold.

I suspect that would be good.  Many Python programs chew through
objects quickly.  Still, for this class of programs, for any large N
any small constant will be too small.

If we care much about this class of examples (loops with no function
calls and no deallocs), would it make sense to count alloc and dealloc
separately?  They would both need to exceed some limit before
triggering GC.