5 Replies Latest reply on May 14, 2008 3:37 AM by timfox

    log.isTraceEnabled() and performance

    timfox

      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.