[jboss-jira] [JBoss JIRA] Updated: (JBCACHE-1301) Checking debug level can improve performance under heavy load
Manik Surtani (JIRA)
jira-events at lists.jboss.org
Mon Mar 3 14:34:59 EST 2008
[ http://jira.jboss.com/jira/browse/JBCACHE-1301?page=all ]
Manik Surtani updated JBCACHE-1301:
-----------------------------------
Fix Version/s: 1.4.X
Complexity: Low
While there is no more development taking place on 1.4.x any more (most of it has been rewritten in 2.x) I will investigate this and see if it makes sense for inclusion in an SP. Thanks for the comments.
> Checking debug level can improve performance under heavy load
> -------------------------------------------------------------
>
> Key: JBCACHE-1301
> URL: http://jira.jboss.com/jira/browse/JBCACHE-1301
> Project: JBoss Cache
> Issue Type: Quality Risk
> Security Level: Public(Everyone can see)
> Affects Versions: 1.4.1.SP8
> Environment: Any
> Reporter: Martin Landua
> Assigned To: Manik Surtani
> Fix For: 1.4.X
>
>
> In the source file ActivationInterceptor.java we experienced severe performance downgrade due to the fact that the debug level is not being checked. The two log statements in lines 152 and 156 result in a call to toString() for the DataNode object. Worst case this can create a huge string which is obsolete if debug is turned off in log4j. Since this occurs in a synchronized block, performance slows down in a multithreaded environment.
> Please consider the following change (checking for debug level):
> synchronized(this) {
> if (fqn != null && nodeRemoved)
> // If the node is being removed, just remove it and don't perform
> // activation processing
> loader.remove(fqn);
> else if (fqn != null && cache.exists(fqn) && loader.exists(fqn)) {
> // Remove the node from the cache loader if it exists in memory,
> // its attributes have been initialized, its children have been loaded,
> // AND it was found in the cache loader (nodeLoaded = true).
> // Then notify the listeners that the node has been activated.
> DataNode n = getNode(fqn); // don't load
> // node not null and attributes have been loaded?
> if (n != null && !n.containsKey(TreeCache.UNINITIALIZED)) {
> if (n.hasChildren()) {
> if (allInitialized(n)) {
> if (log.isDebugEnabled()) log.debug("children all initialized");
> remove(fqn);
> }
> } else if (loaderNoChildren(fqn)) {
> if (log.isDebugEnabled()) log.debug("no children " + n);
> remove(fqn);
> }
> }
> }
--
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