[Python-3000] Is reference counting still needed?

Josiah Carlson jcarlson at uci.edu
Fri Apr 21 08:28:20 CEST 2006


Neil Schemenauer <nas at arctrix.com> wrote:
> Erno Kuusela <erno at iki.fi> wrote:
> > The refcounting vs generational GC reasoning I've heard argues that
> > refcounting is less cache-friendly
> 
> I believe that's correct.  A state of the art generational GC would
> outperform reference counting, even given Python's enormous
> allocation rate.  However, those systems require man years of
> development effort and are not widely portable.
> 
> Perhaps even more seriously, any system that could outperform
> refcounting would require moving objects (at least, AFAIK).  If we
> would want to use such a system, extensions would have to be written
> in a completely different manner.
> 
> The portability problem might be solved by have a pluggable GC
> system: high performance on platforms that support it, simple
> implementation (e.g.  mark and sweep) on platforms that don't.

In my mind, the real question is whether or not the possible speed
improvements on those platforms is worth the "man years of development
effort" (smells doubtful).  If someone begins such an undertaking, it
would also be quite nice if the effort could result in a non-moving GC
(for us C extension writers).

 - Josiah

Also; great work on the original set of Bohem GC patches.  When Tim
posted the link on Wednesday, I almost couldn't believe that it had
already been done.  I had heard occasional references to someone trying
it before in python-dev, and it was good to read through that thread.



More information about the Python-3000 mailing list