A couple garbage collector questions

Alex Martelli aleaxit at yahoo.com
Tue Apr 3 04:28:51 EDT 2001


"Greg Ewing" <greg at cosc.canterbury.ac.nz> wrote in message
news:3AC94B6B.F1F4DDEB at cosc.canterbury.ac.nz...
> Kragen Sitaker wrote:
> >
> > Reference-counting exacts very heavy performance costs, no matter what
> > you back it up with.
>
> Something nobody has mentioned yet is that RC is cache-friendly,

Not necessarily -- it needs to bring the reference count (which
is generally made a part of the object) into cache for every
re-binding affecting the object (on either side).  Without RC,
reference re-binding does not need moving any object into cache.

> whereas pure M&S is quite cache-hostile. This is important

Sure, but it doesn't take very fancy 'generationality' for
general GC to become much better at this.  With RC, fancier
techniques would be needed (keeping the RC's _out_ of all
objects, and in dedicated 'parallel' pages containing RC's
only, may work -- but it's rather tricky to organize, most
particularly if programming otherwise than in the very lowest
level physical-memory-layout-savvy machine-language, and may
not yield as big a cache-friendliness gain as hoped for).


Alex






More information about the Python-list mailing list