[jboss-user] [JBossCache] - JBC 2 performance

aditsu do-not-reply at jboss.com
Fri Jun 29 04:57:26 EDT 2007


I wrote some code that used JBC 1.4.1.SP3, then later I converted it to use JBC 2.0.0.CR2, and I noticed that at least a part of it is running MUCH slower. Like, an order of magnitude slower.

That part of the code is putting a lot of data in the cache. I ran it with a profiler and a debugger, and found that most time is spent in the SimpleEntry constructor (which is getting called over 16 million times in my snapshot).

A frequent call sequence is: 
CacheLoaderInterceptor.createNodes -> findChild -> UnversionedNode.getChildrenMapDirect -> MapCopy -> SimpleEntry. There are a few nodes that have MANY children, and JBC seems to call getChildrenMapDirect() on them repeatedly, and it creates a new MapCopy every time, with a new SimpleEntry for every child.

I looked at the JBC 1.4.1 code, and there CacheLoaderInterceptor.createNodes calls AbstractNode.getChild which calls "get" directly from the children map, without creating thousands of extra objects.
I don't know the reason why UnversionedNode.getChildrenMapDirect now has to make a new MapCopy every time, but I can tell you it seriously affects performance.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059060#4059060

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059060



More information about the jboss-user mailing list