]
Manik Surtani resolved JBCACHE-1253.
------------------------------------
Resolution: Done
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.CR3, 2.1.0.GA
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: