A couple garbage collector questions

Skip Montanaro skip at pobox.com
Thu Apr 5 13:34:52 EDT 2001


    >>> Reference-counting exacts very heavy performance costs, no matter
    >>> what you back it up with.

    Hannah> Correct. *Except* if the compiler does heavy optimization of
    Hannah> reference count updates (i.e. if you can prove that some basic
    Hannah> block just increases the RC, later decreases it, having a net
    Hannah> effect of +- 0, you can drop both RC updates, and so on).

This is unlikely to happen in practice.  A basic block consists of a
straightline piece of code containing no branches.  There's no reason to
increment a reference count and decrement it within the same basic block,
since the object's reference count can't be decremented to zero by some
other piece of code.

-- 
Skip Montanaro (skip at pobox.com)
(847)971-7098




More information about the Python-list mailing list