[Python-Dev] Lazily GC tracking tuples

Kevin Jacobs jacobs@penguin.theopalgroup.com
Tue, 28 May 2002 07:34:58 -0400 (EDT)


On Fri, 24 May 2002, Tim Peters wrote:
> [Kevin Jacobs]
> > Well, I've found one case where the garbage collector _does_ cause
> > serious performance problems, and coincidentally enough it is due to
> > the creation of zillions of cycle-less tuples.  Our current solution has
> > been to disable GC in some parts of our code, and then manually trigger
> > collection at the correct points.  When I can find some free time, I will
> > definitly test drive any available tuple untracking patches to see if
> > they make any substantial difference in our code.
> 
> Well, I'm told it's a 3-day weekend <wink>, and Neil has a short patch you
> can try:
> 
>     http://www.python.org/sf/558745
> 
> If you can, please do.  I view this as a diasaster-insurance change, not as
> a generally applicable speedup (it's almost certainly not, and especially
> not when using a distinct pass to weed out tuples -- I'd combine it with the
> copy-refcounts pass), so this lives or dies on whether it helps people
> suffering pathologies in real life.  That's you.

It doesn't seem to make much difference in our app.  There seems to be some
speedup, but nothing dramatic.  Turning GC on and off at the right times is
still slightly faster.  The good news is that another (unrelated) part of
our code just became about 20-40% faster with this patch, though I need to
do some fairly major surgery to isolate why this is so.

So more sleuthing required,
-Kevin

--
Kevin Jacobs
The OPAL Group - Enterprise Systems Architect
Voice: (216) 986-0710 x 19         E-mail: jacobs@theopalgroup.com
Fax:   (216) 986-0714              WWW:    http://www.theopalgroup.com