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

timfox do-not-reply at jboss.com
Tue May 13 10:35:01 EDT 2008


In performance critical sections of the code we should avoid code like:


  | if (log.isTraceEnabled())
  | {
  |    log.trace("Something");
  | }
  | 

The problem is that the call to log.isTraceEnabled() actually takes up significant time. This is why you'll see in the code the following:


  | if (trace)
  | {
  |   log.trace("okjok");
  | }
  | 

Instead.

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

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



More information about the jboss-dev-forums mailing list