ListEventAssembler and ArrayList

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ListEventAssembler and ArrayList

Merki Fabian (KETO 41)
hi guys
 
i've just run our tool against an optimizing tool and i saw that in ListEventAssembler.fireEvent you/we are creating a lot of object[]. at least please check if the following code would be better:
 
// old
List listenersToNotify = new ArrayList();
List listenerEventsToNotify = new ArrayList();
listenersToNotify.addAll(listeners);
listenerEventsToNotify.addAll(listenerEvents);
 
// new
List listenersToNotify = new ArrayList(listeners);
List listenerEventsToNotify = new ArrayList(listenerEvents);
and also rethink if this is neccessary at all (for 99% apps i think this is not neccessary)...
 
thanks a lot
 
fabian
Reply | Threaded
Open this post in threaded view
|

Re: ListEventAssembler and ArrayList

Jesse Wilson-2
Hey Fabian ----

It's great to have you looking over our code.
I really don't think the protective copy is necessary,
since all the EventLists are protected by read write locks
already.

I think this is probably code that just 'stuck around'
from the early days when Glazed Lists' locking was
not as well defined.

The code review is highly appreciated. If you'd
like to review some more code (or even write unit tests!)
it will be graciously accepted. (We're not seeking
much new feature development for the time being as we
try to stableize & bugfix for a 1.0 release!)

Cheers,
Jesse



On 8/24/05, Merki Fabian (KETO 41) <[hidden email]> wrote:

>  
> hi guys
>  
> i've just run our tool against an optimizing tool and i saw that in
> ListEventAssembler.fireEvent you/we are creating a lot of object[]. at least
> please check if the following code would be better:
>  
> // old
> List listenersToNotify = new ArrayList();
> List listenerEventsToNotify = new ArrayList();
> listenersToNotify.addAll(listeners);
> listenerEventsToNotify.addAll(listenerEvents);
>  
> // new
> List listenersToNotify = new ArrayList(listeners);
> List listenerEventsToNotify = new ArrayList(listenerEvents);
>  
> and also rethink if this is neccessary at all (for 99% apps i think this is
> not neccessary)...
>  
> thanks a lot
>  
> fabian

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: ListEventAssembler and ArrayList

Merki Fabian (KETO 41)
In reply to this post by Merki Fabian (KETO 41)
hi jesse

well actually i didn't plan to review the galzelists but our application (where i've found a lot of improvements too)... *smile*
unfortunately i had to stop the optimization and went back to deliver features ;-)
but anyway i'll keep you updated.

fabian


-----Original Message-----
From: Jesse Wilson [mailto:[hidden email]]
Sent: Mittwoch, 24. August 2005 17:38
To: [hidden email]
Subject: Re: ListEventAssembler and ArrayList


Hey Fabian ----

It's great to have you looking over our code.
I really don't think the protective copy is necessary,
since all the EventLists are protected by read write locks
already.

I think this is probably code that just 'stuck around'
from the early days when Glazed Lists' locking was
not as well defined.

The code review is highly appreciated. If you'd
like to review some more code (or even write unit tests!)
it will be graciously accepted. (We're not seeking
much new feature development for the time being as we
try to stableize & bugfix for a 1.0 release!)

Cheers,
Jesse



On 8/24/05, Merki Fabian (KETO 41) <[hidden email]> wrote:

>  
> hi guys
>  
> i've just run our tool against an optimizing tool and i saw that in
> ListEventAssembler.fireEvent you/we are creating a lot of object[]. at least
> please check if the following code would be better:
>  
> // old
> List listenersToNotify = new ArrayList();
> List listenerEventsToNotify = new ArrayList();
> listenersToNotify.addAll(listeners);
> listenerEventsToNotify.addAll(listenerEvents);
>  
> // new
> List listenersToNotify = new ArrayList(listeners);
> List listenerEventsToNotify = new ArrayList(listenerEvents);
>  
> and also rethink if this is neccessary at all (for 99% apps i think this is
> not neccessary)...
>  
> thanks a lot
>  
> fabian

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]