A couple garbage collector questions

Neelakantan Krishnaswami neelk at alum.mit.edu
Tue Apr 3 21:08:39 EDT 2001


On Tue, 03 Apr 2001 16:02:51 +1200, Greg Ewing <greg at cosc.canterbury.ac.nz>
wrote:
>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,
> whereas pure M&S is quite cache-hostile. This is important now that
> most machine architectures are heavily reliant on cacheing for good
> performance, and I believe that it is one of the main reasons for
> retaining RC alongside the new GC mechanisms.

Naive question: wouldn't adding a word (for the RC) to every object
make locality worse? I'd appreciate an explanation of why it improves
locality -- this seems highly nonintuitive to me. 

Besides, the whole thing seems a moot point to me: dictionaries are
probably the most commonly used data structure in a Python run (they
are used to implement modules, classes, instances, and um dictionaries),
and they are about as cache-hostile a data structure as you can find.


Neel




More information about the Python-list mailing list