At 11:01 PM 2/11/2001 -0800, Jan Dubois wrote:
>[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.

Most perl doesn't use that many objects that live on past what's obvious 
lexically, at least in my experience. (Which may be rather skewed, I admit) 
And the ratio of non-destructible objects to everything else is also very 
small. Even if dealing with destructable things is reasonably expensive, 
the number of places we pay that (and the number of times we pay that) will 
be small enough to balance out. If that turns out not to be the case, then 
we toss the idea and go with plan B.

> >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?

No. Emphasis. I've not been nearly clear enough in the past, apparently.

> >Thank you.
>
>You are welcome!
>
> >I do wish this stuff would flare up during the week...
>
>Why?

Because I don't check my mail often over the weekend, and neither do a 
bunch of other folks. When this stuff crops up over the week, we can work 
things out or get explanations before things start getting hysterical.

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to