[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: log.isTraceEnabled() and performance

timfox do-not-reply at jboss.com
Wed May 14 03:37:49 EDT 2008


"clebert.suconic at jboss.com" wrote : 
  | Still better to not call it when trace is not set IMO.

Yes, log.isTraceEnabled() has a significant overhead.

Actually in JBM 1.4 approx 3% of time was spent in log.isTraceEnabled() calls until we changed it to check a static flag "trace"! (Admittedly we had a lot of log.isTraceEnabled() calls).

Moral of the story: Don't assume that log.isTraceEnabled() (or log.isDebugEnabled()) is a fast call, and never put it in performance critical sections.

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

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



More information about the jboss-dev-forums mailing list