[Python-3000] Is reference counting still needed?

Guido van Rossum guido at python.org
Thu Apr 20 11:16:01 CEST 2006


On 20 Apr 2006 10:15:08 +0300, Erno Kuusela <erno at iki.fi> 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, even when the
> object itself is not accessed in any way. Generational GC is said to
> make the most frequent gc-related memory references somewhat
> localised.

I guess it depends on how refcounting is used. Python has many places
where references are passed without manipulating the refcount. Also,
the argument about dirtying cache lines seem to be relevant to SMP
architectures and probably doesn't apply much to Python as long as we
have the GIL (which is not going away).

--
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list