[moved to -internals]

On Mon, 12 Feb 2001 01:44:54 -0500, Dan Sugalski <[EMAIL PROTECTED]> wrote:

>Perl needs some level of tracking for objects with finalization attached to 
>them. Full refcounting isn't required, however. Also, the vast majority of 
>perl variables have no finalization attached to them.

That's all fine and dandy, but it will be even slower than the current
refcounting scheme (in addition to inc/dec'ing the refcount you *also*
need to check if the current entity is being refcounted).  I'm not saying
that this is necessarily a bad space/time tradeoff.  But many people seem
to think that using mark-and-sweep for garbage collection will be a
performance boost.  This may not be the case if objects still need to
reference counted.

>I do wish people would get garbage collection and finalization split in 
>their minds. They are two separate things which can, and will, be dealt 
>with separately.

Well typically they are not for performance reasons.  In a reference count
based scheme you typically have a destructor that executes whenever the
last reference goes away.  In a mark-and-sweep scheme you can have
finalizers that are being called before the GC discards the object.

Of course you can combine both schemes to decouple destruction from GC,
but you then have to pay the price of both systems.  If you know of a way
around this, please share!

>For the record:
>
>THE GARBAGE COLLECTOR WILL HAVE NOTHING TO DO WITH FINALIZATION, AND NO 
>PERL OBJECT CODE WILL BE CALLED FOR VARIABLES UNDERGOING GARBAGE COLLECTION.

Bad mood?

>Thank you.

You are welcome!

>I do wish this stuff would flare up during the week...

Why?

-Jan

Reply via email to