[jboss-jira] [JBoss JIRA] Updated: (JBCACHE-1253) Unneeded copying of data in Notifier

Manik Surtani (JIRA) jira-events at lists.jboss.org
Tue Jan 1 19:51:53 EST 2008


     [ http://jira.jboss.com/jira/browse/JBCACHE-1253?page=all ]

Manik Surtani updated JBCACHE-1253:
-----------------------------------

    Fix Version/s: 2.1.0.CR3
                   2.1.0.GA

Thanks for the fix, Bela.

> Unneeded copying of data in Notifier
> ------------------------------------
>
>                 Key: JBCACHE-1253
>                 URL: http://jira.jboss.com/jira/browse/JBCACHE-1253
>             Project: JBoss Cache
>          Issue Type: Task
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 2.1.0.CR2
>            Reporter: Bela Ban
>         Assigned To: Manik Surtani
>             Fix For: 2.1.0.GA, 2.1.0.CR3
>
>
> All Notifier.notifyXXX() methods are written like this:
>  public void notifyNodeActivated(Fqn fqn, boolean pre, Map data, InvocationContext ctx)
>    {
>       boolean originLocal = ctx.isOriginLocal();
>       Map dataCopy = copy(data); // <===== COPY !
>       Transaction tx = ctx.getTransaction();
>       List<ListenerInvocation> listeners = listenerInvocations.get(NodeActivated.class);
>       if (listeners != null && listeners.size() > 0)
>       {
>          InvocationContext backup = resetInvocationContext(ctx);
>          // ... bla bla
>       }
>    }
> The data (hashmap) is copied regardless of whether there are actually any listeners, this leads to poor performance. I saw this as hotspot #1 in my perf tests with JBossCache in JProfiler.
> FIX: copy only if there are any listeners

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list