[Python-3000] Is reference counting still needed?

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Apr 20 10:34:02 CEST 2006


Erno Kuusela wrote:

> The refcounting vs generational GC reasoning I've heard argues that
> refcounting is less cache-friendly: The cache line containing the
> refcount field of the pointed-to objects is dirtied (or at least
> loaded) every time something is done with the reference,

Has anyone actually measured this effect in a real
system, or is it just theorising?

If it's a real effect, would this be helped at all if the
refcounts weren't stored with the objects, but kept all
together in one block of memory? Or would that just make
things worse?

With dynamic languages becoming increasingly important
these days, I wonder whether anyone has thought about
what sort of cache or other memory architecture modifications
might make things like refcounting more efficient.

Ideally one would like a memory architecture that is
wired in such a way that it just "knows" which objects
are in use, without needing any explicit refcounting or
garbage collection algorithms. Haven't figured out how
to build such a thing at reasonable cost, though...

--
Greg


More information about the Python-3000 mailing list