org.apache.logging.log4j.perf.jmh
Class DebugDisabledBenchmark

java.lang.Object
  extended by org.apache.logging.log4j.perf.jmh.DebugDisabledBenchmark

public class DebugDisabledBenchmark
extends Object

Benchmarks Log4j 2, Log4j 1, and Logback using the DEBUG level which is disabled for this test. One of the primary performance concerns of logging frameworks is adding minimal overhead when logging is disabled. Some users disable all logging in production, while others disable finer logging levels in production. This benchmark demonstrates the overhead in calling logger.isDebugEnabled() and logger.debug().


Constructor Summary
DebugDisabledBenchmark()
           
 
Method Summary
 boolean baseline()
           
 void log4jClassicDebugStringConcatenation()
           
 boolean log4jClassicIsDebugEnabled()
           
 void log4jDebugParameterizedString()
           
 void log4jDebugStringConcatenation()
           
 boolean log4jIsDebugEnabled()
           
 void setUp()
           
 void slf4jDebugParameterizedString()
           
 void slf4jDebugStringConcatenation()
           
 boolean slf4jIsDebugEnabled()
           
 void tearDown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DebugDisabledBenchmark

public DebugDisabledBenchmark()
Method Detail

setUp

public void setUp()

tearDown

public void tearDown()

baseline

public boolean baseline()

log4jIsDebugEnabled

public boolean log4jIsDebugEnabled()

slf4jIsDebugEnabled

public boolean slf4jIsDebugEnabled()

log4jClassicIsDebugEnabled

public boolean log4jClassicIsDebugEnabled()

log4jDebugStringConcatenation

public void log4jDebugStringConcatenation()

slf4jDebugStringConcatenation

public void slf4jDebugStringConcatenation()

log4jClassicDebugStringConcatenation

public void log4jClassicDebugStringConcatenation()

log4jDebugParameterizedString

public void log4jDebugParameterizedString()

slf4jDebugParameterizedString

public void slf4jDebugParameterizedString()


Copyright c 1999-2014 Apache Software Foundation. All Rights Reserved. Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, and the Apache Logging project logo are trademarks of The Apache Software Foundation.