Finalization enhancement

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Finalization enhancement

Levente Uzonyi-2
Hi,

since WeakRegistry is refactored, there's an easy way to enhance
finalization performance, by changing WeakRegistry >> #installFinalizer's
implementation to

installFinalizer

  valueDictionary finalizer: #finalize

This means that the object finalizers (executors) are not collected, but
are immediately evaluated whenever the WeakRegistry finds them. Therefore
these objects live for a shorter time and need less administration.
But there's a side effect. Currently only the WeakArray finalization
process can evaluate the finalizers'. If we change this, any process which
accesses the WeakRegistry may evaluate finalizers.

I can't think of any problem with the side effect, but I may be
wrong. Should we change the current behavior?


Cheers,
Levente

Reply | Threaded
Open this post in threaded view
|

Re: Finalization enhancement

Levente Uzonyi-2
I uploaded two packages which contain this change. To load it evaluate the
following:

(Installer squeakfoundation project: 'inbox')
  install: 'Collections-ul.310.mcz';
  install: 'Collections-ul.311.mcz'


Levente

On Sun, 21 Feb 2010, Levente Uzonyi wrote:

> Hi,
>
> since WeakRegistry is refactored, there's an easy way to enhance finalization
> performance, by changing WeakRegistry >> #installFinalizer's implementation
> to
>
> installFinalizer
>
> valueDictionary finalizer: #finalize
>
> This means that the object finalizers (executors) are not collected, but are
> immediately evaluated whenever the WeakRegistry finds them. Therefore these
> objects live for a shorter time and need less administration.
> But there's a side effect. Currently only the WeakArray finalization process
> can evaluate the finalizers'. If we change this, any process which accesses
> the WeakRegistry may evaluate finalizers.
>
> I can't think of any problem with the side effect, but I may be wrong. Should
> we change the current behavior?
>
>
> Cheers,
> Levente
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Finalization enhancement

Igor Stasenko
In reply to this post by Levente Uzonyi-2
On 21 February 2010 19:18, Levente Uzonyi <[hidden email]> wrote:

> Hi,
>
> since WeakRegistry is refactored, there's an easy way to enhance
> finalization performance, by changing WeakRegistry >> #installFinalizer's
> implementation to
>
> installFinalizer
>
>        valueDictionary finalizer: #finalize
>
> This means that the object finalizers (executors) are not collected, but are
> immediately evaluated whenever the WeakRegistry finds them. Therefore these
> objects live for a shorter time and need less administration.
> But there's a side effect. Currently only the WeakArray finalization process
> can evaluate the finalizers'. If we change this, any process which accesses
> the WeakRegistry may evaluate finalizers.
>
> I can't think of any problem with the side effect, but I may be wrong.
> Should we change the current behavior?
>
>

My 2c.
I think, if one uses WeakRegistry, he should rely on its behavior. And
if he using own finalization shemes - then he won't be using
WeakRegistry anyways. So, i think it is safe to use optimization
(though i'm not looked at the code).

> Cheers,
> Levente
>
>



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: Finalization enhancement

Andreas.Raab
Igor Stasenko wrote:
> I think, if one uses WeakRegistry, he should rely on its behavior. And
> if he using own finalization shemes - then he won't be using
> WeakRegistry anyways. So, i think it is safe to use optimization
> (though i'm not looked at the code).

Same here.

Cheers,
  - Andreas