Hello, The difference with the documentation and Mathieu's example is the presence of String concatenation. Here lies the performance improvment.
If there a simple String is used, the if is uneeded :) Regards Gil Le 19:58 - mardi 11 déc., Taher Alkhateeb a écrit : > The official documentation mentions that performance is hit [1] with metrics. > > [1] > https://logging.apache.org/log4j/2.x/performance.html#asyncLoggingWithParams > On Tue, Dec 11, 2018 at 7:19 PM Mathieu Lirzin > <mathieu.lir...@nereide.fr> wrote: > > > > He gets exactly the same performance results (1.08× ns/op) with either > > of the following options: > > > > 1) Debug.log("...") > > 2) if (Debug.isEnabled()) { Debug.log("...") } > > 3) Debug.log(() -> "...") > >