Hi,

> Does anyone know what the cost of the isXXXEnabled() methods are? 
>  Should we
> define booleans after Category creation, that can cache these values to
> improve speed, or just keep calling isXXXEnabled() each time?

>From the log4j sources:
  public
  boolean isDebugEnabled() {
    if(hierarchy.disable >=  Priority.DEBUG_INT)
      return false;   
    return Priority.DEBUG.isGreaterOrEqual(this.getChainedPriority());
  }

The getChainedPriority is a recursive method:
    for(Category c = this; c != null; c=c.parent)
    {
       if(c.priority != null) 
         return c.priority;
    }

Save the result in a boolean and test the boolean will improve performance.
I am not at all a performance guru, I have no idea at which level it will.

It is a good idea to do what you propose.

> --jason

Vincent.

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to