org.apache.logging.log4j.perf.jmh
Class ReflectionBenchmark
java.lang.Object
org.apache.logging.log4j.perf.jmh.ReflectionBenchmark
public class ReflectionBenchmark
- extends Object
Benchmarks the different ways the caller class can be obtained.
To run this in sampling mode (latency test):
java -jar microbenchmarks.jar ".*ReflectionBenchmark.*" -i 5 -f 1 -wi 5 -bm sample -tu ns
To run this in throughput testing mode:
java -jar microbenchmarks.jar ".*ReflectionBenchmark.*" -i 5 -f 1 -wi 5 -bm Throughput -tu ms
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReflectionBenchmark
public ReflectionBenchmark()
testBaseline
public void testBaseline(org.openjdk.jmh.logic.BlackHole bh)
getCallerClassNameFromStackTrace
public String getCallerClassNameFromStackTrace(org.openjdk.jmh.logic.BlackHole bh)
getCallerClassNameReflectively
public String getCallerClassNameReflectively(org.openjdk.jmh.logic.BlackHole bh)
getCallerClassNameSunReflection
public String getCallerClassNameSunReflection(org.openjdk.jmh.logic.BlackHole bh)
getStackTraceClassForClassName
public Class<?> getStackTraceClassForClassName()
throws ClassNotFoundException
- Throws:
ClassNotFoundException
getReflectiveCallerClassUtility
public Class<?> getReflectiveCallerClassUtility(org.openjdk.jmh.logic.BlackHole bh)
getDirectSunReflection
public Class<?> getDirectSunReflection(org.openjdk.jmh.logic.BlackHole bh)
getMessageUsingNew
public org.apache.logging.log4j.message.Message getMessageUsingNew(ReflectionBenchmark.RandomInteger rng)
getMessageUsingReflection
public org.apache.logging.log4j.message.Message getMessageUsingReflection(ReflectionBenchmark.RandomInteger rng)
throws NoSuchMethodException,
IllegalAccessException,
InvocationTargetException,
InstantiationException
- Throws:
NoSuchMethodException
IllegalAccessException
InvocationTargetException
InstantiationException
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.