├── results ├── herve-kvm-3-socket │ ├── README.txt │ └── cpu-topology.png ├── herve-kvm-4-socket │ ├── 4socket.png │ └── README.txt ├── herve-kvm-shared-L3 │ ├── cpu-topology.png │ ├── results-2021-08-27T2308-8.txt │ ├── results-2021-08-27T2308-16.txt │ ├── results-2021-08-27T2308-32.txt │ ├── results-2021-08-27T2308-64.txt │ ├── results-2021-08-27T2308-4.txt │ ├── results-2021-08-27T2308-2.txt │ ├── results-2021-08-27T2308-1.txt │ ├── results-2021-08-29T1109-32.txt │ ├── results-2021-08-29T1109-64.txt │ ├── results-2021-08-29T1109-16.txt │ └── results-2021-08-29T1109-8.txt ├── i7-6770HQ-Linux-5.10 │ ├── results-2021-08-30T2315-1.txt │ ├── results-2021-08-30T2315-16.txt │ ├── results-2021-08-30T2315-2.txt │ ├── results-2021-08-30T2315-32.txt │ ├── results-2021-08-30T2315-4.txt │ ├── results-2021-08-30T2315-64.txt │ ├── results-2021-08-30T2315-8.txt │ ├── results-2021-08-31T0935-1.txt │ ├── results-2021-08-31T0935-16.txt │ ├── results-2021-08-31T0935-2.txt │ ├── results-2021-08-31T0935-32.txt │ ├── results-2021-08-31T0935-4.txt │ ├── results-2021-08-31T0935-64.txt │ ├── results-2021-08-31T0935-8.txt │ ├── results-2021-08-31T1208-1.txt │ ├── results-2021-08-31T1208-16.txt │ ├── results-2021-08-31T1208-2.txt │ ├── results-2021-08-31T1208-32.txt │ ├── results-2021-08-31T1208-4.txt │ ├── results-2021-08-31T1208-64.txt │ ├── results-2021-08-31T1208-8.txt │ ├── README.txt │ └── results-2021-08-27T1321-summary.txt ├── i7-8565U-Linux-5.10 │ ├── README.txt │ └── results-2021-08-27T1136-64.txt ├── i7-8565U-windows-4seconds │ ├── results-2021-11-13T1228-16.txt │ ├── results-2021-11-13T1228-4.txt │ └── results-2021-11-13T1228-1.txt └── i7-8565U-windows-60seconds │ └── results-2021-11-13T1035-1.txt ├── .gitattributes ├── .gitignore ├── src └── main │ ├── resources │ ├── logback-minimal.xml │ ├── logback-disabled.xml │ ├── logback-short.xml │ ├── log4j2-async-perf.xml │ ├── log4j-perf.xml │ ├── logback-async-perf.xml │ ├── log4j-async-perf.xml │ ├── log4j-new-async-perf.xml │ ├── log4j2-perf.xml │ ├── logback-perf.xml │ └── logback-twoAppenders.xml │ └── java │ └── ch │ └── qos │ └── logback │ └── perf │ ├── NOPAppender.java │ ├── caller │ ├── CallerCompute9.java │ ├── CallerComputeTest.java │ ├── CallerComputeBenchmark.java │ └── CallerCompute.java │ ├── GetLoggerBenchmark.java │ ├── CachingDateFormatterBenchmark.java │ ├── ProfileFileAppender.java │ ├── LoggerNameBenchmark.java │ ├── mdcAdapter │ └── MDCAdapterBenchmark.java │ ├── FileAppenderBenchmark.java │ ├── DisabledLogger.java │ ├── BenchmarkJoran.java │ └── AsyncWithFileAppenderBenchmark.java ├── extractResults.sh ├── runCallerBenchmark.sh ├── runMDCAdapter.sh ├── runFileAppenderBenchmark.sh ├── runReload4jBenchmark.sh ├── runAsyncBenchmark.sh ├── README.md ├── pom.xml └── help.txt /results/herve-kvm-3-socket/README.txt: -------------------------------------------------------------------------------- 1 | Results for 3 socket configuration on a 4 core hardware 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | runFileAppenderBenchmak.sh text eol=lf 2 | runFileAppenderBenchmark.sh text eol=lf 3 | extractResults.sh text eol=lf -------------------------------------------------------------------------------- /results/herve-kvm-4-socket/4socket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceki/logback-perf/HEAD/results/herve-kvm-4-socket/4socket.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .settings 2 | target 3 | .classpath 4 | .factorypath 5 | .project 6 | .idea 7 | *~ 8 | *.iml 9 | *.ipr 10 | *.iws 11 | -------------------------------------------------------------------------------- /results/herve-kvm-3-socket/cpu-topology.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceki/logback-perf/HEAD/results/herve-kvm-3-socket/cpu-topology.png -------------------------------------------------------------------------------- /results/herve-kvm-shared-L3/cpu-topology.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceki/logback-perf/HEAD/results/herve-kvm-shared-L3/cpu-topology.png -------------------------------------------------------------------------------- /results/i7-6770HQ-Linux-5.10/results-2021-08-30T2315-1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceki/logback-perf/HEAD/results/i7-6770HQ-Linux-5.10/results-2021-08-30T2315-1.txt -------------------------------------------------------------------------------- /results/i7-6770HQ-Linux-5.10/results-2021-08-30T2315-16.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceki/logback-perf/HEAD/results/i7-6770HQ-Linux-5.10/results-2021-08-30T2315-16.txt -------------------------------------------------------------------------------- /results/i7-6770HQ-Linux-5.10/results-2021-08-30T2315-2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceki/logback-perf/HEAD/results/i7-6770HQ-Linux-5.10/results-2021-08-30T2315-2.txt -------------------------------------------------------------------------------- /results/i7-6770HQ-Linux-5.10/results-2021-08-30T2315-32.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceki/logback-perf/HEAD/results/i7-6770HQ-Linux-5.10/results-2021-08-30T2315-32.txt -------------------------------------------------------------------------------- /results/i7-6770HQ-Linux-5.10/results-2021-08-30T2315-4.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceki/logback-perf/HEAD/results/i7-6770HQ-Linux-5.10/results-2021-08-30T2315-4.txt -------------------------------------------------------------------------------- /results/i7-6770HQ-Linux-5.10/results-2021-08-30T2315-64.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceki/logback-perf/HEAD/results/i7-6770HQ-Linux-5.10/results-2021-08-30T2315-64.txt -------------------------------------------------------------------------------- /results/i7-6770HQ-Linux-5.10/results-2021-08-30T2315-8.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceki/logback-perf/HEAD/results/i7-6770HQ-Linux-5.10/results-2021-08-30T2315-8.txt -------------------------------------------------------------------------------- /results/i7-6770HQ-Linux-5.10/results-2021-08-31T0935-1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceki/logback-perf/HEAD/results/i7-6770HQ-Linux-5.10/results-2021-08-31T0935-1.txt -------------------------------------------------------------------------------- /results/i7-6770HQ-Linux-5.10/results-2021-08-31T0935-16.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceki/logback-perf/HEAD/results/i7-6770HQ-Linux-5.10/results-2021-08-31T0935-16.txt -------------------------------------------------------------------------------- /results/i7-6770HQ-Linux-5.10/results-2021-08-31T0935-2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceki/logback-perf/HEAD/results/i7-6770HQ-Linux-5.10/results-2021-08-31T0935-2.txt -------------------------------------------------------------------------------- /results/i7-6770HQ-Linux-5.10/results-2021-08-31T0935-32.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceki/logback-perf/HEAD/results/i7-6770HQ-Linux-5.10/results-2021-08-31T0935-32.txt -------------------------------------------------------------------------------- /results/i7-6770HQ-Linux-5.10/results-2021-08-31T0935-4.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceki/logback-perf/HEAD/results/i7-6770HQ-Linux-5.10/results-2021-08-31T0935-4.txt -------------------------------------------------------------------------------- /results/i7-6770HQ-Linux-5.10/results-2021-08-31T0935-64.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceki/logback-perf/HEAD/results/i7-6770HQ-Linux-5.10/results-2021-08-31T0935-64.txt -------------------------------------------------------------------------------- /results/i7-6770HQ-Linux-5.10/results-2021-08-31T0935-8.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceki/logback-perf/HEAD/results/i7-6770HQ-Linux-5.10/results-2021-08-31T0935-8.txt -------------------------------------------------------------------------------- /results/i7-6770HQ-Linux-5.10/results-2021-08-31T1208-1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceki/logback-perf/HEAD/results/i7-6770HQ-Linux-5.10/results-2021-08-31T1208-1.txt -------------------------------------------------------------------------------- /results/i7-6770HQ-Linux-5.10/results-2021-08-31T1208-16.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceki/logback-perf/HEAD/results/i7-6770HQ-Linux-5.10/results-2021-08-31T1208-16.txt -------------------------------------------------------------------------------- /results/i7-6770HQ-Linux-5.10/results-2021-08-31T1208-2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceki/logback-perf/HEAD/results/i7-6770HQ-Linux-5.10/results-2021-08-31T1208-2.txt -------------------------------------------------------------------------------- /results/i7-6770HQ-Linux-5.10/results-2021-08-31T1208-32.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceki/logback-perf/HEAD/results/i7-6770HQ-Linux-5.10/results-2021-08-31T1208-32.txt -------------------------------------------------------------------------------- /results/i7-6770HQ-Linux-5.10/results-2021-08-31T1208-4.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceki/logback-perf/HEAD/results/i7-6770HQ-Linux-5.10/results-2021-08-31T1208-4.txt -------------------------------------------------------------------------------- /results/i7-6770HQ-Linux-5.10/results-2021-08-31T1208-64.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceki/logback-perf/HEAD/results/i7-6770HQ-Linux-5.10/results-2021-08-31T1208-64.txt -------------------------------------------------------------------------------- /results/i7-6770HQ-Linux-5.10/results-2021-08-31T1208-8.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ceki/logback-perf/HEAD/results/i7-6770HQ-Linux-5.10/results-2021-08-31T1208-8.txt -------------------------------------------------------------------------------- /src/main/resources/logback-minimal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /extractResults.sh: -------------------------------------------------------------------------------- 1 | #for i in 1 2 4 8 16 32 64; do echo $F$i-txt;tail $F$i.txt | grep -a -v Async|grep -a FileA; tail $F$i.txt |grep -a Async; done 2 | for i in 1 4 16 64; do echo $F$i-txt;tail $F$i.txt | grep -a -v Async|grep -a FileA; tail $F$i.txt |grep -a Async; done 3 | -------------------------------------------------------------------------------- /src/main/resources/logback-disabled.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /results/i7-8565U-Linux-5.10/README.txt: -------------------------------------------------------------------------------- 1 | 2 | CPU i7-8565U 4 cores, 2 threads per core, clocked at 1.8 GGz 3 | 4 | L1 cache: 32 KB at 398 GB/s 5 | L2 cache: 256 KB at 132 GB/s 6 | L3 cache: 8192 KB at 73 GB/s 7 | Memory: 15 GB at 13 GB/s 8 | 9 | https://www.cpubenchmark.net/cpu.php?cpu=Intel+Core+i7-8565U+%40+1.80GHz&id=3308 10 | Score: 6373 11 | -------------------------------------------------------------------------------- /src/main/java/ch/qos/logback/perf/NOPAppender.java: -------------------------------------------------------------------------------- 1 | package ch.qos.logback.perf; 2 | 3 | import ch.qos.logback.classic.spi.ILoggingEvent; 4 | import ch.qos.logback.core.UnsynchronizedAppenderBase; 5 | 6 | public class NOPAppender extends UnsynchronizedAppenderBase { 7 | 8 | public int count = 0; 9 | 10 | @Override 11 | protected void append(ILoggingEvent iLoggingEvent) { 12 | count++; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/resources/logback-short.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 8 | 9 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /results/i7-6770HQ-Linux-5.10/README.txt: -------------------------------------------------------------------------------- 1 | CPU i7-6770HQ 4 cores, 2 threads per core, clocked at 2.6 GGz 2 | 3 | L1 cache: 32 KB at 173 GB/s 4 | L2 cache: 256 KB at 74 GB/s 5 | L3 cache: 6144 KB at 48 GB/s 6 | Memory: 16 GB at 19 GB/s 7 | 8 | https://www.cpubenchmark.net/cpu.php?cpu=intel+core+i7-6770hq+%40+2.60ghz&id=2759 9 | Score: 7237 10 | 11 | results-2021-08-31T0935-$TC.txt and results-2021-08-31T1208-$TC.txt 12 | were performed using a USB 3.0 connected WD Mypassport 260D, a 13 | mechanical (rotating) HD with an observed sequential write throughput 14 | rate of 120 MB/sec. 15 | 16 | -------------------------------------------------------------------------------- /results/herve-kvm-4-socket/README.txt: -------------------------------------------------------------------------------- 1 | Herve is a KVM virtual machine installed on a removable SSD Disk. 2 | 3 | 4 | CPU Intel Core Skylake IBRS clocked at 2.0 1.8 GGz 5 | 6 | L1 cache: 64 KB at 190 GB/s 7 | L2 cache: 4096 KB at 54 GB/s 8 | L3 cache: 16384 KB at 13 GB/s 9 | Memory: X GB at 16 GB/s 10 | ============================================= 11 | Actual CPU 12 | 13 | CPU i7-8565U 4 cores, 2 threads per core, clocked at 1.8 GGz 14 | 15 | L1 cache: 32 KB at 398 GB/s 16 | L2 cache: 256 KB at 132 GB/s 17 | L3 cache: 8192 KB at 73 GB/s 18 | Memory: 15 GB at 13 GB/s 19 | ============================================ 20 | -------------------------------------------------------------------------------- /runCallerBenchmark.sh: -------------------------------------------------------------------------------- 1 | 2 | DATE=$(date '+%Y-%m-%dT%H%M') 3 | 4 | echo "Results will be output into file results-${DATE}-[threadCount].txt" 5 | sleep 1 6 | 7 | DATE=$(date '+%Y-%m-%dT%H%M') 8 | 9 | #for TC in 1 2 4 8 16 32 64; 10 | mvn clean 11 | mvn install 12 | 13 | # default run duration of 10 seconds, single fork, time unit: microseconds, 2 warm up iterations, 4 iterations, 14 | # $TC is the thread count, timeout 3 seconds, output results to "results-${DATE}-$TC.txt" 15 | DURATION=4 16 | java -jar target/benchmarks.jar "ch.qos.logback.perf.caller.Caller*" -r $DURATION -f 1 -tu ns -w $DURATION -wi 0 -i 4 -t 1 -to 3 #-o "results-${DATE}-$TC.txt" 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /runMDCAdapter.sh: -------------------------------------------------------------------------------- 1 | 2 | DATE=$(date '+%Y-%m-%dT%H%M') 3 | 4 | echo "Results will be output into file results-${DATE}-[threadCount].txt" 5 | sleep 1 6 | 7 | DATE=$(date '+%Y-%m-%dT%H%M') 8 | 9 | #for TC in 1 2 4 8 16 32 64; 10 | mvn clean 11 | mvn install 12 | 13 | # default run duration of 10 seconds, single fork, time unit: microseconds, 2 warm up iterations, 4 iterations, 14 | # $TC is the thread count, timeout 3 seconds, output results to "results-${DATE}-$TC.txt" 15 | DURATION=10 16 | T=1 17 | TIMEOUT=30 18 | java -jar target/benchmarks.jar "ch.qos.logback.perf.mdcAdapter.MDCAdapterBenchmark" -r $DURATION -f 1 -tu ns -w $DURATION -wi 3 -i 4 -t $T -to $TIMEOUT #-o "results-${DATE}-$TC.txt" 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/main/resources/log4j2-async-perf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | %d %p [%t] %logger - %m%n 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/main/resources/log4j-perf.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/main/resources/logback-async-perf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0 5 | 6 | 7 | 8 | 9 | target/test-output/logback-async-perf.log 10 | 256KB 11 | false 12 | false 13 | 14 | %d %p [%t] %logger - %m%n 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /runFileAppenderBenchmark.sh: -------------------------------------------------------------------------------- 1 | 2 | DATE=$(date '+%Y-%m-%dT%H%M') 3 | 4 | echo "Results will be output into file results-${DATE}-[threadCount].txt" 5 | sleep 1 6 | 7 | DATE=$(date '+%Y-%m-%dT%H%M') 8 | 9 | #for TC in 1 2 4 8 16 32 64; 10 | for TC in 1 4 16 64; 11 | do 12 | mvn clean 13 | mvn install 14 | echo "Number of threads $TC" 15 | # default run duration of 10 seconds, single fork, time unit: microseconds, 2 warm up iterations, 4 iterations, 16 | # $TC is the thread count, timeout 3 seconds, output results to "results-${DATE}-$TC.txt" 17 | DURATION=4 18 | java -jar target/benchmarks.jar ".*FileAppenderBenchmark.*" -r $DURATION -f 1 -tu ms -w $DURATION -wi 0 -i 4 -t $TC -to 3 -o "results-${DATE}-$TC.txt" 19 | done 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /runReload4jBenchmark.sh: -------------------------------------------------------------------------------- 1 | 2 | DATE=$(date '+%Y-%m-%dT%H%M') 3 | 4 | echo "Results will be output into file results-${DATE}-[threadCount].txt" 5 | sleep 1 6 | 7 | DATE=$(date '+%Y-%m-%dT%H%M') 8 | 9 | #for TC in 1 2 4 8 16 32 64; 10 | for TC in 1 4 16 64; 11 | do 12 | mvn clean 13 | mvn install 14 | echo "Number of threads $TC" 15 | # default run duration of 10 seconds, single fork, time unit: microseconds, 2 warm up iterations, 4 iterations, 16 | # $TC is the thread count, timeout 3 seconds, output results to "results-${DATE}-$TC.txt" 17 | DURATION=10 18 | java -jar target/benchmarks.jar ".*FileAppenderBenchmark.reload4jFile" -r $DURATION -f 1 -tu ms -w $DURATION -wi 0 -i 4 -t $TC -to 3 -o "results-${DATE}-$TC.txt" 19 | done 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/main/resources/log4j-async-perf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/main/resources/log4j-new-async-perf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /runAsyncBenchmark.sh: -------------------------------------------------------------------------------- 1 | 2 | DATE=$(date '+%Y-%m-%dT%H%M') 3 | 4 | echo "Results will be output into file results-${DATE}-[threadCount].txt" 5 | sleep 1 6 | 7 | DATE=$(date '+%Y-%m-%dT%H%M') 8 | 9 | #for TC in 1 2 4 8 16 32 64; 10 | mvn clean 11 | mvn install 12 | 13 | TC=1 14 | # default run duration of 10 seconds, single fork, time unit: microseconds, 2 warm up iterations, 4 iterations, 15 | # $TC is the thread count, timeout 3 seconds, output results to "results-${DATE}-$TC.txt" 16 | 17 | # -r time Minimum time to spend at each measurement iteration. Benchmarks may generally run longer than iteration duration. (default: 10 s) 18 | WARM_DURATION=3 19 | RUN_DURATION=30 20 | # -bm [Throughput/thrpt, AverageTime/avgt, SampleTime/sample, SingleShotTime/ss, All/all]. (default: Throughput) 21 | 22 | # -w Minimum time to spend at each warmup iteration. 23 | # -r Minimum time to spend at each measurement iteration. 24 | # -to 1 timeout 25 | TO=1 26 | 27 | java -jar target/benchmarks.jar "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.*.*" -r $DURATION -f 1 -tu ms -r $RUN_DURATION -w $WARM_DURATION -wi 2 -i 4 -t $TC -to $TO -o "results-${DATE}-$TC.txt" 28 | -------------------------------------------------------------------------------- /src/main/java/ch/qos/logback/perf/caller/CallerCompute9.java: -------------------------------------------------------------------------------- 1 | package ch.qos.logback.perf.caller; 2 | import java.lang.StackWalker.StackFrame; 3 | import java.util.List; 4 | 5 | public class CallerCompute9 { 6 | 7 | static private StackWalker WALKER = StackWalker.getInstance(); 8 | static String THIS_CLASS_NAME = CallerCompute9.class.getName(); 9 | 10 | static public String getCallerClass9(int bump) { 11 | 12 | //List frames = WALKER.walk(s -> s.limit(4).collect(Collectors.toList())); 13 | List frames = WALKER.walk(s -> s.limit(4).toList()); 14 | 15 | int frameCount = frames.size(); 16 | 17 | // Advance until CallerCompute9 is found 18 | int i; 19 | for (i = 0; i < frameCount; i++) { 20 | if (THIS_CLASS_NAME.equals(frames.get(i).getClassName())) 21 | break; 22 | } 23 | 24 | // trace[i] = Util; trace[i+1] = caller; trace[i+2] = caller's caller 25 | if (i >= frameCount || i + bump >= frameCount) { 26 | throw new IllegalStateException("Failed to find org.slf4j.helpers.CallerCompute or its caller in the stack; " + "this should not happen"); 27 | } 28 | return frames.get(i+bump).getClassName(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/resources/log4j2-perf.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | %d %p [%t] %logger - %m%n 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/main/resources/logback-perf.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | target/test-output/logback-perf.log 22 | 256KB 23 | false 24 | false 25 | 26 | %d %p [%t] %c - %m%n 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/main/java/ch/qos/logback/perf/GetLoggerBenchmark.java: -------------------------------------------------------------------------------- 1 | package ch.qos.logback.perf; 2 | 3 | import java.util.concurrent.TimeUnit; 4 | 5 | import org.openjdk.jmh.annotations.Benchmark; 6 | import org.openjdk.jmh.annotations.BenchmarkMode; 7 | import org.openjdk.jmh.annotations.Mode; 8 | import org.openjdk.jmh.annotations.OutputTimeUnit; 9 | import org.openjdk.jmh.annotations.Scope; 10 | import org.openjdk.jmh.annotations.Setup; 11 | import org.openjdk.jmh.annotations.State; 12 | import org.slf4j.Logger; 13 | import org.slf4j.LoggerFactory; 14 | 15 | /** 16 | * Benchmark LoggerFactory.getLogger() method 17 | * 18 | * @author ceki 19 | * 20 | */ 21 | //HOW TO RUN THIS TEST 22 | //java -jar logback-perf/target/benchmarks.jar ".*GetLoggerBenchmark.*" -f 1 23 | //-wi 10 -i 20 24 | // 25 | //RUNNING THIS TEST WITH 4 THREADS: 26 | //java -jar logback-perf/target/benchmarks.jar ".*GetLoggerBenchmark.*" -f 1 27 | //-wi 10 -i 20 -t 4 28 | @State(Scope.Thread) 29 | public class GetLoggerBenchmark { 30 | 31 | 32 | @Setup 33 | public void setUp() throws Exception { 34 | System.setProperty("logback.configurationFile", "logback-short.xml"); 35 | } 36 | 37 | @BenchmarkMode(Mode.Throughput) 38 | @OutputTimeUnit(TimeUnit.MICROSECONDS) 39 | @Benchmark 40 | public void getLogger() { 41 | Logger logger = LoggerFactory.getLogger(GetLoggerBenchmark.class); 42 | logger.trace("hello"); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/resources/logback-twoAppenders.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | infoLog.log 5 | 6 | infoLogs.%d{yyyy-MM-dd}.log 7 | 8 | 30 9 | 3GB 10 | 11 | 12 | 13 | INFO 14 | 15 | 16 | 17 | %-4relative [%thread] %-5level %logger{35} - %msg%n 18 | 19 | 20 | 21 | 22 | 24 | errorLog.log 25 | 26 | errorLogs.%d{yyyy-MM-dd}.log 27 | 28 | 30 29 | 3GB 30 | 31 | 32 | 33 | ERROR 34 | 35 | 36 | 37 | %-4relative [%thread] %-5level %logger{35} - %msg%n 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/main/java/ch/qos/logback/perf/caller/CallerComputeTest.java: -------------------------------------------------------------------------------- 1 | package ch.qos.logback.perf.caller; 2 | 3 | import static org.junit.Assert.assertEquals; 4 | 5 | import org.junit.Ignore; 6 | import org.junit.Test; 7 | 8 | public class CallerComputeTest { 9 | 10 | @Test 11 | public void testViaSecurityManager() { 12 | String result = CallerCompute.getCallingClassViaSecurityManager(1); 13 | assertEquals(CallerComputeTest.class.getName(), result); 14 | } 15 | 16 | @Test 17 | @Ignore 18 | public void testViaReflection() { 19 | String result = CallerCompute.getCallingClassViaReflection(); 20 | assertEquals(CallerComputeTest.class.getName(), result); 21 | } 22 | 23 | 24 | @Test 25 | public void testgetCallerClassViaThreadAPI() { 26 | String result = CallerCompute.getCallerClassViaThreadAPI(1); 27 | assertEquals(CallerComputeTest.class.getName(), result); 28 | } 29 | 30 | @Test 31 | public void testWalkerAPI() { 32 | String result = CallerCompute9.getCallerClass9(1); 33 | assertEquals(CallerComputeTest.class.getName(), result); 34 | } 35 | 36 | // @Test 37 | // public void testCallerViaMethodName() { 38 | // String result = CallerCompute.getCallerViaMethodHandles(); 39 | // Lookup lk = MethodHandles.publicLookup();// Lookup(this.getClass()); 40 | // lk. 41 | // System.out.println(result); 42 | // assertEquals(CallerComputeTest.class.getName(), result); 43 | // } 44 | 45 | } -------------------------------------------------------------------------------- /src/main/java/ch/qos/logback/perf/CachingDateFormatterBenchmark.java: -------------------------------------------------------------------------------- 1 | package ch.qos.logback.perf; 2 | 3 | import java.util.concurrent.TimeUnit; 4 | 5 | import org.openjdk.jmh.annotations.Benchmark; 6 | import org.openjdk.jmh.annotations.BenchmarkMode; 7 | import org.openjdk.jmh.annotations.Mode; 8 | import org.openjdk.jmh.annotations.OutputTimeUnit; 9 | import org.openjdk.jmh.annotations.Scope; 10 | import org.openjdk.jmh.annotations.Setup; 11 | import org.openjdk.jmh.annotations.State; 12 | 13 | import ch.qos.logback.core.CoreConstants; 14 | import ch.qos.logback.core.util.CachingDateFormatter; 15 | 16 | 17 | /** 18 | * Benchmark ch.qos.logback.core.util.CachingDateFormatter.format method 19 | * 20 | * @author ceki 21 | * 22 | */ 23 | //HOW TO RUN THIS TEST 24 | //java -jar logback-perf/target/benchmarks.jar ".*CachingDateFormatterBenchmark.*" -f 1 25 | //-wi 10 -i 20 26 | // 27 | //RUNNING THIS TEST WITH 4 THREADS: 28 | //java -jar logback-perf/target/benchmarks.jar ".*CachingDateFormatterBenchmark.*" -f 1 29 | //-wi 10 -i 20 -t 4 30 | @State(Scope.Benchmark) 31 | public class CachingDateFormatterBenchmark { 32 | 33 | 34 | CachingDateFormatter cachingDateFormatter; 35 | 36 | @Setup 37 | public void setUp() throws Exception { 38 | cachingDateFormatter = new CachingDateFormatter(CoreConstants.ISO8601_PATTERN); 39 | } 40 | 41 | @BenchmarkMode(Mode.Throughput) 42 | @OutputTimeUnit(TimeUnit.MICROSECONDS) 43 | @Benchmark 44 | public void format() { 45 | cachingDateFormatter.format(System.currentTimeMillis()); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/ch/qos/logback/perf/caller/CallerComputeBenchmark.java: -------------------------------------------------------------------------------- 1 | package ch.qos.logback.perf.caller; 2 | 3 | import java.lang.invoke.MethodHandles; 4 | import java.util.concurrent.TimeUnit; 5 | 6 | import org.openjdk.jmh.annotations.Benchmark; 7 | import org.openjdk.jmh.annotations.BenchmarkMode; 8 | import org.openjdk.jmh.annotations.Mode; 9 | import org.openjdk.jmh.annotations.OutputTimeUnit; 10 | import org.openjdk.jmh.annotations.Scope; 11 | import org.openjdk.jmh.annotations.State; 12 | import java.util.logging.LogRecord; 13 | import java.util.logging.Level; 14 | 15 | @State(Scope.Benchmark) 16 | public class CallerComputeBenchmark { 17 | 18 | public String result; 19 | 20 | @BenchmarkMode(Mode.AverageTime) 21 | @OutputTimeUnit(TimeUnit.MICROSECONDS) 22 | @Benchmark 23 | public void benchmarkgetCallingClassViaSecurityManager() { 24 | result = CallerCompute.getCallingClassViaSecurityManager(1); 25 | } 26 | 27 | @BenchmarkMode(Mode.AverageTime) 28 | @OutputTimeUnit(TimeUnit.MICROSECONDS) 29 | @Benchmark 30 | public void benchmarkgetCallerClassViaThreadAPI() { 31 | result = CallerCompute.getCallerClassViaThreadAPI(1); 32 | } 33 | 34 | @BenchmarkMode(Mode.AverageTime) 35 | @OutputTimeUnit(TimeUnit.MICROSECONDS) 36 | @Benchmark 37 | public void benchmarWalkerAPI() { 38 | LogRecord lr = new LogRecord(Level.INFO, "a"); 39 | result = CallerCompute9.getCallerClass9(1); 40 | } 41 | 42 | @BenchmarkMode(Mode.AverageTime) 43 | @OutputTimeUnit(TimeUnit.MICROSECONDS) 44 | @Benchmark 45 | public void benchmarMethodHandler() { 46 | LogRecord lr = new LogRecord(Level.INFO, "a"); 47 | result = CallerCompute.getCallingClassViaMethondHander(1); 48 | } 49 | 50 | @BenchmarkMode(Mode.AverageTime) 51 | @OutputTimeUnit(TimeUnit.MICROSECONDS) 52 | @Benchmark 53 | public void benchmarJULLogger() { 54 | LogRecord lr = new LogRecord(Level.INFO, "a"); 55 | result = lr.getSourceClassName(); 56 | 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Logback benchmarking project 2 | 3 | This mini benchmark project is intended to help improve logback's performance. It isa 4 | also useful in comparing logback against other logging frameworks such as 5 | log4j and log4j2. 6 | 7 | Please refer to the [logback benchmark page](http://logback.qos.ch/performance.html) for a 8 | general discussion about the logic behind this benchmark and an analysis of the results. 9 | 10 | Results are also viewable as a [**Google doc spreadsheet**.](https://docs.google.com/spreadsheets/d/1cpb5D7qnyye4W0RTlHUnXedYK98catNZytYIu5D91m0/edit?usp=sharing) 11 | 12 | # Do run the benchmark on your own 13 | 14 | We welcome all suggestions. You are also highly encouraged to run the 15 | benchmarks in your own computing environment and file a pull request. 16 | 17 | Once you change your current folder to the foder where you cloned the 18 | logback-perf project, the the command to build the benchmark is: 19 | 20 | mvn install; # this builds the benchmark under target/benchmarks.jar 21 | 22 | The command to run the benchmark is: 23 | 24 | rm target/test-output/*; # make sure to delete any files from previous runs 25 | java -jar target/benchmarks.jar ".*FileAppenderBenchmark.*" -f 1 -tu ms -wi 2 -i 4 -to 3 -t $TC` 26 | 27 | where `$TC` stands for thread count, assuming the values in the set 28 | {1, 2, 4, 8, 16, 32, 64}. 29 | 30 | Note that before running the benchmark, be sure to delete the files under 31 | the `target/test-output/` folder between runs. 32 | 33 | Alternatively, you can run the `runFileAppenderBenchmark.sh` script which performs the 34 | clean up, and saves the results in timestamped files. 35 | 36 | In the this spirit of result verifiability, we encourage *everyone* to 37 | run the `runFileAppenderBenchmak.sh` script and add their results under 38 | the `results` folder and a sub-folder named after the CPU/host where the 39 | test was run. Please send a pull request with your results. 40 | 41 | We feel that results provided by neutral parties, that is by 42 | developers not directly affiliated with the logback project, lends 43 | more credibility to our benchmarking results. 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/main/java/ch/qos/logback/perf/ProfileFileAppender.java: -------------------------------------------------------------------------------- 1 | package ch.qos.logback.perf; 2 | 3 | import java.io.File; 4 | 5 | import org.openjdk.jmh.annotations.Setup; 6 | import org.openjdk.jmh.annotations.TearDown; 7 | import org.slf4j.LoggerFactory; 8 | 9 | public class ProfileFileAppender { 10 | public static final String MESSAGE = "This is a debug message"; 11 | org.slf4j.Logger slf4jLogger; 12 | 13 | @Setup 14 | public void setUp() throws Exception { 15 | System.setProperty("logback.configurationFile", "logback-perf.xml"); 16 | deleteLogFiles(); 17 | slf4jLogger = LoggerFactory.getLogger(ProfileFileAppender.class); 18 | 19 | } 20 | 21 | @TearDown 22 | public void tearDown() { 23 | System.clearProperty("log4j.configurationFile"); 24 | System.clearProperty("log4j.configuration"); 25 | System.clearProperty("logback.configurationFile"); 26 | 27 | deleteLogFiles(); 28 | } 29 | 30 | private void deleteLogFiles() { 31 | final File logbackFile = new File("target/testlogback.log"); 32 | logbackFile.delete(); 33 | } 34 | 35 | void warmUp() { 36 | for (int i = 0; i < 100000; i++) { 37 | slf4jLogger.debug(MESSAGE); 38 | } 39 | } 40 | 41 | void mainLoop() { 42 | int runLen = 1000 * 1000; 43 | for (int i = 0; i < runLen; i++) { 44 | slf4jLogger.debug(MESSAGE); 45 | } 46 | 47 | } 48 | 49 | public static void main(String[] args) throws Exception { 50 | ProfileFileAppender bench = new ProfileFileAppender(); 51 | bench.setUp(); 52 | 53 | bench.warmUp(); 54 | Thread.yield(); 55 | 56 | int threadCount = 2; 57 | Runnable[] runnableArray = bench.buildRunnables(threadCount); 58 | bench.execute(runnableArray); 59 | 60 | bench.tearDown(); 61 | 62 | System.out.println("Exiting FileAppenderBenchmark"); 63 | } 64 | 65 | 66 | Runnable[] buildRunnables(int count) { 67 | Runnable[] ra = new Runnable[count]; 68 | for(int i = 0; i < count; i++) { 69 | ra[i] = new MainLoopRunnable(); 70 | } 71 | return ra; 72 | } 73 | 74 | class MainLoopRunnable implements Runnable { 75 | 76 | @Override 77 | public void run() { 78 | ProfileFileAppender.this.mainLoop(); 79 | } 80 | 81 | } 82 | 83 | public void execute(Runnable[] runnableArray) throws InterruptedException { 84 | Thread[] threadArray = new Thread[runnableArray.length]; 85 | 86 | for (int i = 0; i < runnableArray.length; i++) { 87 | threadArray[i] = new Thread(runnableArray[i], "Harness[" + i + "]"); 88 | } 89 | for (Thread t : threadArray) { 90 | t.start(); 91 | } 92 | 93 | for (Thread t : threadArray) { 94 | t.join(); 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /src/main/java/ch/qos/logback/perf/LoggerNameBenchmark.java: -------------------------------------------------------------------------------- 1 | package ch.qos.logback.perf; 2 | 3 | import java.nio.file.Files; 4 | import java.nio.file.Paths; 5 | import java.util.List; 6 | import java.util.concurrent.TimeUnit; 7 | import java.util.stream.Collectors; 8 | 9 | import org.openjdk.jmh.annotations.Benchmark; 10 | import org.openjdk.jmh.annotations.BenchmarkMode; 11 | import org.openjdk.jmh.annotations.Mode; 12 | import org.openjdk.jmh.annotations.OutputTimeUnit; 13 | import org.openjdk.jmh.annotations.Scope; 14 | import org.openjdk.jmh.annotations.Setup; 15 | import org.openjdk.jmh.annotations.State; 16 | import org.slf4j.Logger; 17 | import org.slf4j.LoggerFactory; 18 | 19 | import ch.qos.logback.classic.LoggerContext; 20 | import ch.qos.logback.classic.pattern.LoggerConverter; 21 | import ch.qos.logback.classic.pattern.LoggerNameOnlyLoggingEvent; 22 | import ch.qos.logback.classic.testUtil.Gaussian; 23 | import ch.qos.logback.core.status.OnFileStatusListener; 24 | 25 | /** 26 | * Benchmark LoggerNameBenchmark logger name abbreviation 27 | * 28 | * @author ceki 29 | */ 30 | 31 | //HOW TO RUN THIS TEST 32 | //java -jar logback-perf/target/benchmarks.jar ".*LoggerNameBenchmark.*" -f 1 33 | //-wi 10 -i 20 34 | // 35 | //RUNNING THIS TEST WITH 4 THREADS:ja 36 | //java -jar logback-perf/target/benchmarks.jar ".*GetLoggerBenchmark.*" -f 1 37 | //-wi 10 -i 20 -t 4 38 | @State(Scope.Thread) 39 | public class LoggerNameBenchmark { 40 | 41 | static final String NAMES_FILE = "src/main/resources/fqcn.txt"; 42 | 43 | @State(Scope.Benchmark) 44 | public static class MyState { 45 | List namesList; 46 | 47 | int size; 48 | double mean; 49 | double deviation; 50 | Gaussian g; 51 | 52 | LoggerContext loggerContext = new LoggerContext(); 53 | LoggerConverter loggerConverter = new LoggerConverter(); 54 | 55 | LoggerNameOnlyLoggingEvent event = new LoggerNameOnlyLoggingEvent(); 56 | 57 | Logger logger = LoggerFactory.getLogger(this.getClass()); 58 | 59 | @Setup 60 | public void setUp() throws Exception { 61 | loadClassNames(); 62 | setUpVariables(); 63 | } 64 | 65 | public void loadClassNames() throws Exception { 66 | namesList = Files.lines(Paths.get(NAMES_FILE)).collect(Collectors.toList()); 67 | 68 | size = namesList.size(); 69 | mean = size / 16; 70 | deviation = mean / 2; 71 | g = new Gaussian(mean, deviation); 72 | System.out.println("names list size=" + size); 73 | } 74 | 75 | public void setUpVariables() { 76 | OnFileStatusListener ofsl = new OnFileStatusListener(); 77 | ofsl.setContext(loggerContext); 78 | ofsl.setFilename("status.txt"); 79 | ofsl.start(); 80 | loggerContext.getStatusManager().add(ofsl); 81 | loggerConverter.setOptionList(List.of("30")); 82 | loggerConverter.setContext(loggerContext); 83 | loggerConverter.start(); 84 | } 85 | 86 | } 87 | 88 | 89 | 90 | @BenchmarkMode(Mode.SampleTime) 91 | @OutputTimeUnit(TimeUnit.NANOSECONDS) 92 | @Benchmark 93 | public void performAbbreviation(MyState state) { 94 | String fqn = getFQN(state); 95 | state.event.setLoggerName(fqn); 96 | state.loggerConverter.convert(state.event); 97 | } 98 | 99 | private String getFQN(MyState state) { 100 | while (true) { 101 | int index = (int) state.g.getGaussian(); 102 | if (index >= 0 && index < state.size) { 103 | return state.namesList.get(index); 104 | } else { 105 | continue; 106 | } 107 | } 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /src/main/java/ch/qos/logback/perf/mdcAdapter/MDCAdapterBenchmark.java: -------------------------------------------------------------------------------- 1 | package ch.qos.logback.perf.mdcAdapter; 2 | 3 | import ch.qos.logback.classic.util.LogbackMDCAdapter; 4 | import ch.qos.logback.classic.util.LogbackMDCAdapterSimple; 5 | 6 | import org.openjdk.jmh.annotations.Benchmark; 7 | import org.openjdk.jmh.annotations.BenchmarkMode; 8 | import org.openjdk.jmh.annotations.Mode; 9 | import org.openjdk.jmh.annotations.OutputTimeUnit; 10 | import org.openjdk.jmh.annotations.Scope; 11 | import org.openjdk.jmh.annotations.Setup; 12 | import org.openjdk.jmh.annotations.State; 13 | import org.slf4j.spi.MDCAdapter; 14 | 15 | import java.util.concurrent.TimeUnit; 16 | 17 | @State(Scope.Benchmark) 18 | public class MDCAdapterBenchmark { 19 | 20 | 21 | public static final int NONE = 0; 22 | public static final int LONG = 256; 23 | public static final int SHORT = 16; 24 | 25 | LogbackMDCAdapter mdcAdapter = new LogbackMDCAdapter(); 26 | LogbackMDCAdapterSimple mdcAdapterSimple = new LogbackMDCAdapterSimple(); 27 | 28 | @Setup 29 | public void setUp() throws Exception { 30 | } 31 | 32 | // 33 | // @BenchmarkMode(Mode.AverageTime) 34 | // @OutputTimeUnit(TimeUnit.MICROSECONDS) 35 | // @Benchmark 36 | // public void benchmarkComplexMDCAdapterNone() { 37 | // run(mdcAdapter, NONE); 38 | // } 39 | // 40 | // @BenchmarkMode(Mode.AverageTime) 41 | // @OutputTimeUnit(TimeUnit.MICROSECONDS) 42 | // @Benchmark 43 | // public void benchmarkComplexMDCAdapterShort() { 44 | // run(mdcAdapter, SHORT); 45 | // } 46 | // 47 | // 48 | // @BenchmarkMode(Mode.AverageTime) 49 | // @OutputTimeUnit(TimeUnit.MICROSECONDS) 50 | // @Benchmark 51 | // public void benchmarkComplexMDCAdapterLong() { 52 | // run(mdcAdapter, LONG); 53 | // } 54 | 55 | 56 | // @BenchmarkMode(Mode.AverageTime) 57 | // @OutputTimeUnit(TimeUnit.MICROSECONDS) 58 | // @Benchmark 59 | // public void benchmarkSimpleMDCAdapterNone() { 60 | // run(mdcAdapterSimple, NONE); 61 | // } 62 | // 63 | @BenchmarkMode(Mode.AverageTime) 64 | @OutputTimeUnit(TimeUnit.MICROSECONDS) 65 | @Benchmark 66 | public void benchmarkSimpleMDCAdapterShort() { 67 | run(mdcAdapterSimple, SHORT); 68 | } 69 | 70 | 71 | @BenchmarkMode(Mode.AverageTime) 72 | @OutputTimeUnit(TimeUnit.MICROSECONDS) 73 | @Benchmark 74 | public void benchmarkSimpleMDCAdapterLong() { 75 | run(mdcAdapterSimple, LONG); 76 | } 77 | 78 | 79 | // @BenchmarkMode(Mode.AverageTime) 80 | // @OutputTimeUnit(TimeUnit.MICROSECONDS) 81 | // @Benchmark 82 | // public void benchmarkFranzMDCAdapterNone() { 83 | // run(mdcAdapterFranz, NONE); 84 | // } 85 | // 86 | 87 | 88 | private void run(MDCAdapter mdcAdapter, final int len) { 89 | mdcAdapter.put("REQUEST_ID", "0123456789012345678900123456789"); 90 | mdcAdapter.put("REFERENCE", "ASADFASFSDFKLG"); 91 | mdcAdapter.put("HOST", "toto.foo.com"); 92 | 93 | if (mdcAdapter instanceof LogbackMDCAdapter) { 94 | LogbackMDCAdapter logbackMDCAdapter = (LogbackMDCAdapter) mdcAdapter; 95 | for (int i = 0; i < len; i++) { 96 | logbackMDCAdapter.getPropertyMap(); 97 | } 98 | return; 99 | } 100 | 101 | if (mdcAdapter instanceof LogbackMDCAdapterSimple) { 102 | LogbackMDCAdapterSimple logbackMDCAdapterSimple = (LogbackMDCAdapterSimple) mdcAdapter; 103 | for (int i = 0; i < len; i++) { 104 | logbackMDCAdapterSimple.getPropertyMap(); 105 | } 106 | return; 107 | } 108 | 109 | } 110 | 111 | } 112 | -------------------------------------------------------------------------------- /src/main/java/ch/qos/logback/perf/caller/CallerCompute.java: -------------------------------------------------------------------------------- 1 | package ch.qos.logback.perf.caller; 2 | 3 | import java.lang.invoke.MethodHandles; 4 | 5 | public class CallerCompute { 6 | 7 | private static ClassContextSecurityManager SECURITY_MANAGER; 8 | private static boolean SECURITY_MANAGER_CREATION_ALREADY_ATTEMPTED = false; 9 | 10 | /** 11 | * In order to call {@link SecurityManager#getClassContext()}, which is a 12 | * protected method, we add this wrapper which allows the method to be visible 13 | * inside this package. 14 | */ 15 | private static final class ClassContextSecurityManager extends SecurityManager { 16 | protected Class[] getClassContext() { 17 | return super.getClassContext(); 18 | } 19 | } 20 | 21 | public static String getCallingClassViaReflection() { 22 | //return jdk.internal.reflect.Reflection.getCallerClass().getName(); 23 | return ""; 24 | } 25 | 26 | private static ClassContextSecurityManager safeCreateSecurityManager() { 27 | try { 28 | return new ClassContextSecurityManager(); 29 | } catch (java.lang.SecurityException sm) { 30 | return null; 31 | } 32 | } 33 | private static ClassContextSecurityManager getSecurityManager() { 34 | if (SECURITY_MANAGER != null) 35 | return SECURITY_MANAGER; 36 | else if (SECURITY_MANAGER_CREATION_ALREADY_ATTEMPTED) 37 | return null; 38 | else { 39 | SECURITY_MANAGER = safeCreateSecurityManager(); 40 | SECURITY_MANAGER_CREATION_ALREADY_ATTEMPTED = true; 41 | return SECURITY_MANAGER; 42 | } 43 | } 44 | 45 | static public String getCallerClassViaThreadAPI(int bump) { 46 | StackTraceElement[] trace = Thread.currentThread().getStackTrace(); 47 | String thisClassName = CallerCompute.class.getName(); 48 | 49 | // Advance until Util is found 50 | int i; 51 | for (i = 0; i < trace.length; i++) { 52 | if (thisClassName.equals(trace[i].getClassName())) 53 | break; 54 | } 55 | 56 | // trace[i] = Util; trace[i+1] = caller; trace[i+2] = caller's caller 57 | if (i >= trace.length || i + bump >= trace.length) { 58 | throw new IllegalStateException("Failed to find org.slf4j.helpers.CallerCompute or its caller in the stack; " + "this should not happen"); 59 | } 60 | return trace[i + bump].getClassName(); 61 | } 62 | 63 | /** 64 | * Returns the name of the class which called the invoking method. 65 | * 66 | * @return the name of the class which called the invoking method. 67 | */ 68 | public static String getCallingClassViaSecurityManager(int bump) { 69 | ClassContextSecurityManager securityManager = getSecurityManager(); 70 | if (securityManager == null) 71 | return null; 72 | Class[] trace = securityManager.getClassContext(); 73 | String thisClassName = CallerCompute.class.getName(); 74 | 75 | // Advance until Util is found 76 | int i; 77 | for (i = 0; i < trace.length; i++) { 78 | if (thisClassName.equals(trace[i].getName())) 79 | break; 80 | } 81 | 82 | // trace[i] = Util; trace[i+1] = caller; trace[i+2] = caller's caller 83 | if (i >= trace.length || i + bump >= trace.length) { 84 | throw new IllegalStateException("Failed to find org.slf4j.helpers.Util or its caller in the stack; " + "this should not happen"); 85 | } 86 | 87 | return trace[i + bump].getName(); 88 | } 89 | 90 | public static Class aClass; 91 | 92 | public static String getCallingClassViaMethondHander(int bump) { 93 | aClass = MethodHandles.lookup().lookupClass(); 94 | return aClass.getName(); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /results/i7-6770HQ-Linux-5.10/results-2021-08-27T1321-summary.txt: -------------------------------------------------------------------------------- 1 | results-2021-08-27T1321-1-txt 2 | FileAppenderBenchmark.log4j1File thrpt 12 1053.167 ± 26.158 ops/ms 3 | FileAppenderBenchmark.log4j2File thrpt 12 1251.346 ± 51.999 ops/ms 4 | FileAppenderBenchmark.logbackFile thrpt 12 1843.782 ± 48.984 ops/ms 5 | AsyncWithFileAppenderBenchmark.log4j1File thrpt 12 1012.538 ± 19.305 ops/ms 6 | AsyncWithFileAppenderBenchmark.log4j2AsyncFile thrpt 12 1232.376 ± 76.125 ops/ms 7 | AsyncWithFileAppenderBenchmark.logbackFile thrpt 12 1921.964 ± 84.688 ops/ms 8 | results-2021-08-27T1321-2-txt 9 | FileAppenderBenchmark.log4j1File thrpt 12 766.276 ± 15.023 ops/ms 10 | FileAppenderBenchmark.log4j2File thrpt 12 1529.964 ± 16.651 ops/ms 11 | FileAppenderBenchmark.logbackFile thrpt 12 2114.775 ± 129.031 ops/ms 12 | AsyncWithFileAppenderBenchmark.log4j1File thrpt 12 977.745 ± 58.490 ops/ms 13 | AsyncWithFileAppenderBenchmark.log4j2AsyncFile thrpt 12 1156.614 ± 90.689 ops/ms 14 | AsyncWithFileAppenderBenchmark.logbackFile thrpt 12 1692.588 ± 129.970 ops/ms 15 | results-2021-08-27T1321-4-txt 16 | FileAppenderBenchmark.log4j1File thrpt 12 814.250 ± 11.284 ops/ms 17 | FileAppenderBenchmark.log4j2File thrpt 12 1431.537 ± 253.554 ops/ms 18 | FileAppenderBenchmark.logbackFile thrpt 12 1702.739 ± 40.997 ops/ms 19 | AsyncWithFileAppenderBenchmark.log4j1File thrpt 12 914.801 ± 41.654 ops/ms 20 | AsyncWithFileAppenderBenchmark.log4j2AsyncFile thrpt 12 1108.911 ± 91.980 ops/ms 21 | AsyncWithFileAppenderBenchmark.logbackFile thrpt 12 1642.364 ± 49.951 ops/ms 22 | results-2021-08-27T1321-8-txt 23 | FileAppenderBenchmark.log4j1File thrpt 12 803.536 ± 18.296 ops/ms 24 | FileAppenderBenchmark.log4j2File thrpt 12 1350.924 ± 41.750 ops/ms 25 | FileAppenderBenchmark.logbackFile thrpt 12 1727.973 ± 51.786 ops/ms 26 | AsyncWithFileAppenderBenchmark.log4j1File thrpt 12 905.808 ± 54.445 ops/ms 27 | AsyncWithFileAppenderBenchmark.log4j2AsyncFile thrpt 12 1097.256 ± 76.009 ops/ms 28 | AsyncWithFileAppenderBenchmark.logbackFile thrpt 12 1607.005 ± 52.882 ops/ms 29 | results-2021-08-27T1321-16-txt 30 | FileAppenderBenchmark.log4j1File thrpt 12 799.801 ± 18.818 ops/ms 31 | FileAppenderBenchmark.log4j2File thrpt 12 1284.621 ± 52.927 ops/ms 32 | FileAppenderBenchmark.logbackFile thrpt 12 1745.192 ± 54.530 ops/ms 33 | AsyncWithFileAppenderBenchmark.log4j1File thrpt 12 892.459 ± 35.248 ops/ms 34 | AsyncWithFileAppenderBenchmark.log4j2AsyncFile thrpt 12 995.391 ± 21.649 ops/ms 35 | AsyncWithFileAppenderBenchmark.logbackFile thrpt 12 1583.016 ± 60.233 ops/ms 36 | results-2021-08-27T1321-32-txt 37 | FileAppenderBenchmark.log4j1File thrpt 12 801.627 ± 7.684 ops/ms 38 | FileAppenderBenchmark.log4j2File thrpt 12 1281.883 ± 54.734 ops/ms 39 | FileAppenderBenchmark.logbackFile thrpt 12 1696.089 ± 58.689 ops/ms 40 | AsyncWithFileAppenderBenchmark.log4j1File thrpt 12 883.881 ± 37.605 ops/ms 41 | AsyncWithFileAppenderBenchmark.log4j2AsyncFile thrpt 12 1019.942 ± 71.886 ops/ms 42 | AsyncWithFileAppenderBenchmark.logbackFile thrpt 12 1520.295 ± 56.371 ops/ms 43 | results-2021-08-27T1321-64-txt 44 | FileAppenderBenchmark.log4j1File thrpt 12 827.558 ± 11.938 ops/ms 45 | FileAppenderBenchmark.log4j2File thrpt 12 1380.424 ± 90.988 ops/ms 46 | FileAppenderBenchmark.logbackFile thrpt 12 1729.511 ± 62.083 ops/ms 47 | AsyncWithFileAppenderBenchmark.log4j1File thrpt 12 895.351 ± 59.688 ops/ms 48 | AsyncWithFileAppenderBenchmark.log4j2AsyncFile thrpt 12 1048.110 ± 84.777 ops/ms 49 | AsyncWithFileAppenderBenchmark.logbackFile thrpt 12 1525.028 ± 125.606 ops/ms 50 | -------------------------------------------------------------------------------- /src/main/java/ch/qos/logback/perf/FileAppenderBenchmark.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache license, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the license for the specific language governing permissions and 15 | * limitations under the license. 16 | */ 17 | package ch.qos.logback.perf; 18 | 19 | import java.io.File; 20 | import java.util.concurrent.TimeUnit; 21 | 22 | import org.apache.logging.log4j.LogManager; 23 | import org.apache.logging.log4j.Logger; 24 | import org.openjdk.jmh.annotations.Benchmark; 25 | import org.openjdk.jmh.annotations.BenchmarkMode; 26 | import org.openjdk.jmh.annotations.Mode; 27 | import org.openjdk.jmh.annotations.OutputTimeUnit; 28 | import org.openjdk.jmh.annotations.Scope; 29 | import org.openjdk.jmh.annotations.Setup; 30 | import org.openjdk.jmh.annotations.State; 31 | import org.openjdk.jmh.annotations.TearDown; 32 | import org.slf4j.LoggerFactory; 33 | 34 | 35 | /** 36 | * Benchmarks Log4j 2, Reload4j, Logback and JUL using the DEBUG level which is 37 | * enabled for this test. The configuration for each uses a FileAppender 38 | */ 39 | // HOW TO RUN THIS TEST 40 | // java -jar logback-perf/target/benchmarks.jar ".*FileAppenderBenchmark.*" -f 1 41 | // -wi 10 -i 20 42 | // 43 | // RUNNING THIS TEST WITH 4 THREADS: 44 | // java -jar logback-perf/target/benchmarks.jar ".*FileAppenderBenchmark.*" -f 1 45 | // -wi 10 -i 20 -t 4 46 | @State(Scope.Benchmark) 47 | public class FileAppenderBenchmark { 48 | public static final String MESSAGE = "This is a debug message"; 49 | public static final String LOGBACK_FILE_PATH = "target/test-output/logback-perf.log"; 50 | public static final String LOG4J2_FILE_PATH = "target/test-output/log4j2-perf.log"; 51 | public static final String LOG4J_FILE_PATH = "target/test-output/log4j-perf.log"; 52 | 53 | Logger log4j2Logger; 54 | org.slf4j.Logger slf4jLogger; 55 | org.apache.log4j.Logger reload4jLogger; 56 | java.util.logging.Logger julLogger; 57 | String outFolder = ""; 58 | 59 | 60 | @Setup 61 | public void setUp() throws Exception { 62 | System.setProperty("log4j.configurationFile", "log4j2-perf.xml"); 63 | System.setProperty("logback.configurationFile", "logback-perf.xml"); 64 | System.setProperty("log4j.configuration", "log4j-perf.xml"); 65 | 66 | outFolder = System.getProperty("outFolder", ""); 67 | 68 | deleteLogFiles(); 69 | 70 | String loggerName = "ch.qos.logback.perf.FileAppenderBenchmark"; 71 | 72 | log4j2Logger = LogManager.getLogger(loggerName); 73 | slf4jLogger = LoggerFactory.getLogger(loggerName); 74 | reload4jLogger = org.apache.log4j.Logger.getLogger(loggerName); 75 | 76 | } 77 | 78 | @TearDown 79 | public void tearDown() { 80 | System.clearProperty("log4j.configurationFile"); 81 | System.clearProperty("log4j.configuration"); 82 | System.clearProperty("logback.configurationFile"); 83 | 84 | deleteLogFiles(); 85 | } 86 | 87 | private void deleteLogFiles() { 88 | final File logbackFile = new File(LOGBACK_FILE_PATH); 89 | logbackFile.delete(); 90 | 91 | final File log4jFile = new File(LOG4J_FILE_PATH); 92 | log4jFile.delete(); 93 | 94 | final File log4j2File = new File(LOG4J2_FILE_PATH); 95 | log4j2File.delete(); 96 | } 97 | 98 | @BenchmarkMode(Mode.Throughput) 99 | @OutputTimeUnit(TimeUnit.MILLISECONDS) 100 | @Benchmark 101 | public void log4j2File() { 102 | log4j2Logger.debug(MESSAGE); 103 | } 104 | 105 | @BenchmarkMode(Mode.Throughput) 106 | @OutputTimeUnit(TimeUnit.MILLISECONDS) 107 | @Benchmark 108 | public void logbackFile() { 109 | slf4jLogger.debug(MESSAGE); 110 | } 111 | 112 | @BenchmarkMode(Mode.Throughput) 113 | @OutputTimeUnit(TimeUnit.MILLISECONDS) 114 | @Benchmark 115 | public void reload4jFile() { 116 | reload4jLogger.debug(MESSAGE); 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /src/main/java/ch/qos/logback/perf/DisabledLogger.java: -------------------------------------------------------------------------------- 1 | package ch.qos.logback.perf; 2 | 3 | import org.openjdk.jmh.annotations.Benchmark; 4 | import org.openjdk.jmh.annotations.BenchmarkMode; 5 | import org.openjdk.jmh.annotations.Mode; 6 | import org.openjdk.jmh.annotations.OutputTimeUnit; 7 | import org.openjdk.jmh.annotations.Scope; 8 | import org.openjdk.jmh.annotations.Setup; 9 | import org.openjdk.jmh.annotations.State; 10 | import org.openjdk.jmh.annotations.TearDown; 11 | import org.slf4j.Logger; 12 | import org.slf4j.LoggerFactory; 13 | 14 | import java.util.concurrent.TimeUnit; 15 | 16 | // HOW TO RUN THIS TEST 17 | // java -jar logback-perf/target/benchmarks.jar ".*DisabledLogger.*" -wi 3 -i 3 -f 3 18 | 19 | // Notable results 20 | 21 | // Benchmark Mode Cnt Score Error Units 22 | // DisabledLogger.directDisabled avgt 12 1.172 ± 0.049 ns/op 23 | // DisabledLogger.directEnabled avgt 12 68.901 ± 1.172 ns/op 24 | // DisabledLogger.directMixed avgt 12 71.301 ± 2.194 ns/op 25 | 26 | // DisabledLogger.fluentDisabled avgt 12 0.989 ± 0.030 ns/op 27 | // DisabledLogger.fluentEnabled avgt 12 88.098 ± 2.157 ns/op 28 | // DisabledLogger.fluentMixed avgt 12 89.583 ± 3.157 ns/op 29 | 30 | // DisabledLogger.fluentLongDisabled avgt 12 0.980 ± 0.012 ns/op 31 | // DisabledLogger.fluentLongEnabled avgt 12 95.781 ± 1.540 ns/op 32 | // DisabledLogger.fluentLongMixed avgt 12 99.017 ± 2.514 ns/op 33 | 34 | @State(Scope.Benchmark) 35 | public class DisabledLogger { 36 | 37 | Logger logger; 38 | 39 | static int RUN_LENGTH = 100; 40 | 41 | static final String[] PARAMS = { "val0", "val1" }; 42 | 43 | @Setup 44 | public void setUp() throws Exception { 45 | System.setProperty("logback.configurationFile", "logback-disabled.xml"); 46 | logger = LoggerFactory.getLogger(this.getClass()); 47 | } 48 | 49 | @TearDown 50 | public void tearDown() { 51 | System.clearProperty("logback.configurationFile"); 52 | } 53 | 54 | @BenchmarkMode(Mode.AverageTime) 55 | @OutputTimeUnit(TimeUnit.NANOSECONDS) 56 | @Benchmark 57 | public void directDisabled() { 58 | logger.debug("jello p0={}, p1={}", PARAMS[0], PARAMS[1]); 59 | } 60 | 61 | @BenchmarkMode(Mode.AverageTime) 62 | @OutputTimeUnit(TimeUnit.NANOSECONDS) 63 | @Benchmark 64 | public void directEnabled() { 65 | logger.info("jello p0={}, p1={}", PARAMS[0], PARAMS[1]); 66 | } 67 | 68 | @BenchmarkMode(Mode.AverageTime) 69 | @OutputTimeUnit(TimeUnit.NANOSECONDS) 70 | @Benchmark 71 | public void directMixed() { 72 | logger.info("jello p0={}, p1={}", PARAMS[0], PARAMS[1]); 73 | logger.debug("jello p0={}, p1={}", PARAMS[0], PARAMS[1]); 74 | } 75 | 76 | @BenchmarkMode(Mode.AverageTime) 77 | @OutputTimeUnit(TimeUnit.NANOSECONDS) 78 | @Benchmark 79 | public void fluentDisabled() { 80 | logger.atDebug().addArgument(PARAMS[0]).addArgument(PARAMS[1]).setMessage("jello p0={}, p1={}").log(); 81 | } 82 | 83 | @BenchmarkMode(Mode.AverageTime) 84 | @OutputTimeUnit(TimeUnit.NANOSECONDS) 85 | @Benchmark 86 | public void fluentEnabled() { 87 | logger.atInfo().addArgument(PARAMS[0]).addArgument(PARAMS[1]).setMessage("jello p0={}, p1={}").log(); 88 | } 89 | 90 | @BenchmarkMode(Mode.AverageTime) 91 | @OutputTimeUnit(TimeUnit.NANOSECONDS) 92 | @Benchmark 93 | public void fluentMixed() { 94 | logger.atInfo().addArgument(PARAMS[0]).addArgument(PARAMS[1]).setMessage("jello p0={}, p1={}").log(); 95 | logger.atDebug().addArgument(PARAMS[0]).addArgument(PARAMS[1]).setMessage("jello p0={}, p1={}").log(); 96 | } 97 | 98 | @BenchmarkMode(Mode.AverageTime) 99 | @OutputTimeUnit(TimeUnit.NANOSECONDS) 100 | @Benchmark 101 | public void fluentLongDisabled() { 102 | logger.atDebug().addArgument(PARAMS[0]).addArgument(PARAMS[1]).addKeyValue("a", "a").addKeyValue("b", "b").setMessage("jello p0={}, p1={}") 103 | .log(); 104 | } 105 | 106 | @BenchmarkMode(Mode.AverageTime) 107 | @OutputTimeUnit(TimeUnit.NANOSECONDS) 108 | @Benchmark 109 | public void fluentLongEnabled() { 110 | logger.atInfo().addArgument(PARAMS[0]).addArgument(PARAMS[1]).addKeyValue("a", "a").addKeyValue("b", "b").setMessage("jello p0={}, p1={}") 111 | .log(); 112 | } 113 | 114 | @BenchmarkMode(Mode.AverageTime) 115 | @OutputTimeUnit(TimeUnit.NANOSECONDS) 116 | @Benchmark 117 | public void fluentLongMixed() { 118 | logger.atInfo().addArgument(PARAMS[0]).addArgument(PARAMS[1]).addKeyValue("a", "a").addKeyValue("b", "b").setMessage("jello p0={}, p1={}") 119 | .log(); 120 | logger.atDebug().addArgument(PARAMS[0]).addArgument(PARAMS[1]).addKeyValue("a", "a").addKeyValue("b", "b").setMessage("jello p0={}, p1={}") 121 | .log(); 122 | } 123 | } 124 | 125 | 126 | -------------------------------------------------------------------------------- /src/main/java/ch/qos/logback/perf/BenchmarkJoran.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oracle America, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * * Neither the name of Oracle nor the names of its contributors may be used 16 | * to endorse or promote products derived from this software without 17 | * specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 29 | * THE POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | package ch.qos.logback.perf; 33 | 34 | import org.junit.Test; 35 | import org.openjdk.jmh.annotations.Benchmark; 36 | import org.openjdk.jmh.annotations.BenchmarkMode; 37 | import org.openjdk.jmh.annotations.Mode; 38 | 39 | import ch.qos.logback.classic.LoggerContext; 40 | import ch.qos.logback.classic.joran.JoranConfigurator; 41 | import ch.qos.logback.core.joran.spi.JoranException; 42 | 43 | /** 44 | 45 | Given that we are most interested in start up times, one iteration makes most sense, 46 | i.e. -i 1 as command line parameter: 47 | 48 | wi: number of warmup iterations 49 | i: umber of benchmarked iterations, use 10 or more to get a good idea 50 | tu: timeunit 51 | 52 | java -jar target/benchmarks.jar '.*BenchmarkJoran' -wi 0 -i 3 -tu us 53 | 54 | Benchmark Mode Cnt Score Error Units 55 | BenchmarkJoran.testPropertySetterLongerConfig ss 30 43885.034 ± 32561.156 us/op 56 | BenchmarkJoran.testPropertySetterShortConfig ss 30 33825.291 ± 29224.442 us/op 57 | singleShotPropertySetterLongerConfig time in us:19526 58 | 59 | 60 | 1053831.706 61 | Using java.beans.Introspector 62 | Benchmark Mode Cnt Score Error Units 63 | BenchmarkJoran.testPropertySetterLongerConfig ss 30 49013.013 ± 37679.223 us/op 64 | BenchmarkJoran.testPropertySetterShortConfig ss 30 35981.958 ± 31635.148 us/op 65 | 10 iterations avg. time: 20605 us 66 | */ 67 | 68 | //@State(Scope.Benchmark) 69 | public class BenchmarkJoran { 70 | 71 | @Benchmark 72 | @BenchmarkMode(Mode.SingleShotTime) 73 | public void testPropertySetterShortConfig() throws JoranException { 74 | LoggerContext loggerContext = new LoggerContext(); 75 | JoranConfigurator joran = new JoranConfigurator(); 76 | joran.setContext(loggerContext); 77 | joran.doConfigure("src/main/resources/logback-short.xml"); 78 | } 79 | 80 | @Benchmark 81 | @BenchmarkMode(Mode.SingleShotTime) 82 | public void testPropertySetterLongerConfig() throws JoranException { 83 | LoggerContext loggerContext = new LoggerContext(); 84 | JoranConfigurator joran = new JoranConfigurator(); 85 | joran.setContext(loggerContext); 86 | joran.doConfigure("src/main/resources/logback-twoAppenders.xml"); 87 | } 88 | 89 | @Test 90 | public void singleShotPropertySetterLongerConfig() throws JoranException { 91 | long start = System.nanoTime(); 92 | int count = 10; 93 | for (int i = 0; i < count; i++) { 94 | LoggerContext loggerContext = new LoggerContext(); 95 | JoranConfigurator joran = new JoranConfigurator(); 96 | joran.setContext(loggerContext); 97 | joran.doConfigure("src/main/resources/logback-twoAppenders.xml"); 98 | } 99 | long end = System.nanoTime(); 100 | System.out.println("singleShotPropertySetterLongerConfig time in us:" + (end - start) / (count*1000)); 101 | } 102 | 103 | @Benchmark 104 | @BenchmarkMode(Mode.SingleShotTime) 105 | public void testPropertySetterMinimalConfig() throws JoranException { 106 | LoggerContext loggerContext = new LoggerContext(); 107 | JoranConfigurator joran = new JoranConfigurator(); 108 | joran.setContext(loggerContext); 109 | joran.doConfigure("src/main/resources/logback-minimal.xml"); 110 | } 111 | 112 | } 113 | -------------------------------------------------------------------------------- /results/i7-8565U-Linux-5.10/results-2021-08-27T1136-64.txt: -------------------------------------------------------------------------------- 1 | # JMH version: 1.29 2 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 3 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 4 | # VM options: 5 | # Blackhole mode: full + dont-inline hint 6 | # Warmup: 2 iterations, 10 s each 7 | # Measurement: 6 iterations, 4 s each 8 | # Timeout: 10 min per iteration 9 | # Threads: 64 threads, will synchronize iterations 10 | # Benchmark mode: Throughput, ops/time 11 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j1File 12 | 13 | # Run progress: 0.00% complete, ETA 00:08:48 14 | # Fork: 1 of 2 15 | # Warmup Iteration 1: 888.919 ops/ms 16 | # Warmup Iteration 2: 885.892 ops/ms 17 | Iteration 1: 859.202 ops/ms 18 | Iteration 2: 991.476 ops/ms 19 | Iteration 3: 989.237 ops/ms 20 | Iteration 4: 992.911 ops/ms 21 | Iteration 5: 953.689 ops/ms 22 | Iteration 6: 884.548 ops/ms 23 | 24 | # Run progress: 8.33% complete, ETA 00:08:12 25 | # Fork: 2 of 2 26 | # Warmup Iteration 1: 970.379 ops/ms 27 | # Warmup Iteration 2: 872.218 ops/ms 28 | Iteration 1: 855.370 ops/ms 29 | Iteration 2: 869.343 ops/ms 30 | Iteration 3: 872.673 ops/ms 31 | Iteration 4: 867.513 ops/ms 32 | Iteration 5: 896.862 ops/ms 33 | Iteration 6: 917.505 ops/ms 34 | 35 | 36 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j1File": 37 | 912.527 ±(99.9%) 70.066 ops/ms [Average] 38 | (min, avg, max) = (855.370, 912.527, 992.911), stdev = 54.703 39 | CI (99.9%): [842.462, 982.593] (assumes normal distribution) 40 | 41 | 42 | # JMH version: 1.29 43 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 44 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 45 | # VM options: 46 | # Blackhole mode: full + dont-inline hint 47 | # Warmup: 2 iterations, 10 s each 48 | # Measurement: 6 iterations, 4 s each 49 | # Timeout: 10 min per iteration 50 | # Threads: 64 threads, will synchronize iterations 51 | # Benchmark mode: Throughput, ops/time 52 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j2AsyncFile 53 | 54 | # Run progress: 16.67% complete, ETA 00:07:33 55 | # Fork: 1 of 2 56 | # Warmup Iteration 1: 1105.144 ops/ms 57 | # Warmup Iteration 2: 1043.040 ops/ms 58 | Iteration 1: 1045.351 ops/ms 59 | Iteration 2: 1043.775 ops/ms 60 | Iteration 3: 1097.441 ops/ms 61 | Iteration 4: 1145.151 ops/ms 62 | Iteration 5: 1146.914 ops/ms 63 | Iteration 6: 1136.541 ops/ms 64 | 65 | # Run progress: 25.00% complete, ETA 00:07:02 66 | # Fork: 2 of 2 67 | # Warmup Iteration 1: 1002.388 ops/ms 68 | # Warmup Iteration 2: 1035.908 ops/ms 69 | Iteration 1: 1036.082 ops/ms 70 | Iteration 2: 1097.330 ops/ms 71 | Iteration 3: 1201.224 ops/ms 72 | Iteration 4: 1184.537 ops/ms 73 | Iteration 5: 1184.183 ops/ms 74 | Iteration 6: 1183.822 ops/ms 75 | 76 | 77 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j2AsyncFile": 78 | 1125.196 ±(99.9%) 76.957 ops/ms [Average] 79 | (min, avg, max) = (1036.082, 1125.196, 1201.224), stdev = 60.083 80 | CI (99.9%): [1048.239, 1202.153] (assumes normal distribution) 81 | 82 | 83 | # JMH version: 1.29 84 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 85 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 86 | # VM options: 87 | # Blackhole mode: full + dont-inline hint 88 | # Warmup: 2 iterations, 10 s each 89 | # Measurement: 6 iterations, 4 s each 90 | # Timeout: 10 min per iteration 91 | # Threads: 64 threads, will synchronize iterations 92 | # Benchmark mode: Throughput, ops/time 93 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.logbackFile 94 | 95 | # Run progress: 33.33% complete, ETA 00:06:22 96 | # Fork: 1 of 2 97 | # Warmup Iteration 1: 1580.326 ops/ms 98 | # Warmup Iteration 2: 1543.658 ops/ms 99 | Iteration 1: 1442.331 ops/ms 100 | Iteration 2: 1495.238 ops/ms 101 | Iteration 3: 1520.972 ops/ms 102 | Iteration 4: 1614.733 ops/ms 103 | Iteration 5: 1448.648 ops/ms 104 | Iteration 6: 1473.727 ops/ms 105 | 106 | # Run progress: 41.67% complete, ETA 00:05:31 107 | # Fork: 2 of 2 108 | # Warmup Iteration 1: 1462.827 ops/ms 109 | # Warmup Iteration 2: 1448.257 ops/ms 110 | Iteration 1: 1628.767 ops/ms 111 | Iteration 2: 1455.895 ops/ms 112 | Iteration 3: 1440.759 ops/ms 113 | Iteration 4: 1564.412 ops/ms 114 | Iteration 5: 1444.586 ops/ms 115 | Iteration 6: 1403.265 ops/ms 116 | 117 | 118 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.logbackFile": 119 | 1494.444 ±(99.9%) 93.424 ops/ms [Average] 120 | (min, avg, max) = (1403.265, 1494.444, 1628.767), stdev = 72.939 121 | CI (99.9%): [1401.020, 1587.869] (assumes normal distribution) 122 | 123 | 124 | # JMH version: 1.29 125 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 126 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 127 | # VM options: 128 | # Blackhole mode: full + dont-inline hint 129 | # Warmup: 2 iterations, 10 s each 130 | # Measurement: 6 iterations, 4 s each 131 | # Timeout: 10 min per iteration 132 | # Threads: 64 threads, will synchronize iterations 133 | # Benchmark mode: Throughput, ops/time 134 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.log4j1File 135 | 136 | # Run progress: 50.00% complete, ETA 00:04:43 137 | # Fork: 1 of 2 138 | # Warmup Iteration 1: 830.675 ops/ms 139 | # Warmup Iteration 2: 832.252 ops/ms 140 | Iteration 1: 821.376 ops/ms 141 | Iteration 2: 733.815 ops/ms 142 | Iteration 3: 819.829 ops/ms 143 | Iteration 4: 832.500 ops/ms 144 | Iteration 5: 835.362 ops/ms 145 | Iteration 6: 830.591 ops/ms 146 | 147 | # Run progress: 58.33% complete, ETA 00:03:55 148 | # Fork: 2 of 2 149 | # Warmup Iteration 1: 802.704 ops/ms 150 | # Warmup Iteration 2: -------------------------------------------------------------------------------- /src/main/java/ch/qos/logback/perf/AsyncWithFileAppenderBenchmark.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache license, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the license for the specific language governing permissions and 15 | * limitations under the license. 16 | */ 17 | package ch.qos.logback.perf; 18 | 19 | import java.io.File; 20 | import java.util.concurrent.TimeUnit; 21 | 22 | import org.apache.logging.log4j.LogManager; 23 | import org.apache.logging.log4j.Logger; 24 | import org.openjdk.jmh.annotations.Benchmark; 25 | import org.openjdk.jmh.annotations.BenchmarkMode; 26 | import org.openjdk.jmh.annotations.Mode; 27 | import org.openjdk.jmh.annotations.OutputTimeUnit; 28 | import org.openjdk.jmh.annotations.Scope; 29 | import org.openjdk.jmh.annotations.Setup; 30 | import org.openjdk.jmh.annotations.State; 31 | import org.openjdk.jmh.annotations.TearDown; 32 | import org.openjdk.jmh.runner.Runner; 33 | import org.openjdk.jmh.runner.options.ChainedOptionsBuilder; 34 | import org.openjdk.jmh.runner.options.Options; 35 | import org.openjdk.jmh.runner.options.OptionsBuilder; 36 | import org.openjdk.jmh.runner.options.TimeValue; 37 | import org.slf4j.LoggerFactory; 38 | 39 | /** 40 | * Benchmarks Logback AsyncAppender in conjunction with FileAppender 41 | * 42 | * */ 43 | 44 | // HOW TO RUN THIS TEST 45 | // 46 | //java -jar target/benchmarks.jar ".*AsyncWithFileAppenderBenchmark.*" -f 1 -tu ms -wi 2 -i 10 -t {1,2,4,16,32,64} 47 | 48 | @State(Scope.Benchmark) 49 | public class AsyncWithFileAppenderBenchmark { 50 | public static final String MESSAGE = "This is a debug message"; 51 | 52 | public static final String LOGBACK_ASYNC_FILE_PATH = "target/test-output/logback-async-perf.log"; 53 | public static final String LOG4J2_ASYNC_FILE_PATH = "target/test-output/log4j2-async-perf.log"; 54 | public static final String LOG4J_ASYNC_FILE_PATH = "target/test-output/log4j-async-perf.log"; 55 | //public static final String LOG4J_ASYNC_FILE_PATH = "target/test-output/log4j-new-async-perf.log"; 56 | 57 | Logger log4j2Logger; 58 | Logger log4j2RandomLogger; 59 | org.slf4j.Logger slf4jLogger; 60 | org.apache.log4j.Logger reload4jLogger; 61 | 62 | @Setup 63 | public void setUp() throws Exception { 64 | 65 | System.setProperty("log4j2.contextSelector", "org.apache.logging.log4j.core.async.AsyncLoggerContextSelector"); 66 | System.setProperty("log4j.configurationFile", "log4j2-async-perf.xml"); 67 | System.setProperty("logback.configurationFile", "logback-async-perf.xml"); 68 | //System.setProperty("log4j.configuration", "log4j-async-perf.xml"); 69 | System.setProperty("log4j.configuration", "log4j-new-async-perf.xml"); 70 | deleteLogFiles(); 71 | 72 | log4j2Logger = LogManager.getLogger(this.getClass()); 73 | slf4jLogger = LoggerFactory.getLogger(this.getClass()); 74 | reload4jLogger = org.apache.log4j.Logger.getLogger(this.getClass()); 75 | } 76 | 77 | @TearDown 78 | public void tearDown() { 79 | System.clearProperty("log4j2.contextSelector"); 80 | System.clearProperty("log4j.configurationFile"); 81 | System.clearProperty("log4j.configuration"); 82 | System.clearProperty("logback.configurationFile"); 83 | 84 | // better to delete files in setUp not in tearrDown! 85 | //deleteLogFiles(); 86 | } 87 | 88 | private void deleteLogFiles() { 89 | System.out.println("Deleting files if existent."); 90 | chattyDelete(LOGBACK_ASYNC_FILE_PATH); 91 | chattyDelete(LOG4J2_ASYNC_FILE_PATH); 92 | chattyDelete(LOG4J_ASYNC_FILE_PATH); 93 | } 94 | 95 | private void chattyDelete(String path) { 96 | final File file2Delete = new File(path); 97 | if (!file2Delete.exists()) { 98 | return; 99 | } 100 | System.out.println("About to delete [" + path + "]"); 101 | boolean result = file2Delete.delete(); 102 | if (!result) 103 | System.out.println("Failed to delete " + path); 104 | } 105 | 106 | @BenchmarkMode(Mode.Throughput) 107 | @OutputTimeUnit(TimeUnit.MILLISECONDS) 108 | @Benchmark 109 | public void logbackFile() { 110 | slf4jLogger.debug(MESSAGE); 111 | } 112 | 113 | // @BenchmarkMode(Mode.Throughput) 114 | //@OutputTimeUnit(TimeUnit.MILLISECONDS) 115 | // @Benchmark 116 | public void log4j2AsyncFile() { 117 | log4j2Logger.debug(MESSAGE); 118 | } 119 | 120 | @BenchmarkMode(Mode.Throughput) 121 | @OutputTimeUnit(TimeUnit.MILLISECONDS) 122 | @Benchmark 123 | public void reload4jFile() { 124 | reload4jLogger.debug(MESSAGE); 125 | } 126 | 127 | public static void main(String[] args) throws Exception { 128 | ChainedOptionsBuilder chainedOptionsBuilder = new OptionsBuilder() 129 | .include(AsyncWithFileAppenderBenchmark.class.getName() + ".*") 130 | .mode(Mode.Throughput) 131 | .timeUnit(TimeUnit.MILLISECONDS) 132 | .warmupTime(TimeValue.seconds(3)) 133 | .warmupIterations(2) 134 | .measurementIterations(2) 135 | .measurementTime(TimeValue.seconds(30)) 136 | .timeout(TimeValue.seconds(2)) 137 | .forks(1) 138 | .shouldFailOnError(true) 139 | .shouldDoGC(true) 140 | .threads(1) 141 | .jvm("/java/jdk-21.0.1//bin/java") 142 | .jvmArgs("-Xmx8192m") 143 | //.addProfiler("gc") 144 | // .addProfiler("perfnorm") 145 | // .addProfiler("perfasm") 146 | //.addProfiler("jfr"); 147 | ; 148 | Options options = chainedOptionsBuilder.build(); 149 | 150 | new Runner(options).run(); 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 4.0.0 5 | 6 | ch.qos.logback 7 | logback-perf 8 | 1.0 9 | jar 10 | 11 | Logback-perf 12 | 13 | 14 | UTF-8 15 | 1.37 16 | 21 17 | benchmarks 18 | 19 | 20 | 1.5.12 21 | 2.0.16 22 | 23 | 1.2.26-SNAPSHOT 24 | 2.17.2 25 | 3.13.0 26 | 27 | 28 | 29 | 30 | org.openjdk.jmh 31 | jmh-core 32 | ${jmh.version} 33 | 34 | 35 | org.openjdk.jmh 36 | jmh-generator-annprocess 37 | ${jmh.version} 38 | provided 39 | 40 | 41 | 42 | 43 | org.slf4j 44 | slf4j-api 45 | ${slf4j.version} 46 | 47 | 48 | 49 | ch.qos.logback 50 | logback-classic 51 | ${lb.version} 52 | 53 | 54 | 55 | ch.qos.logback 56 | logback-classic 57 | test-jar 58 | ${lb.version} 59 | 60 | 61 | 62 | ch.qos.reload4j 63 | reload4j 64 | ${reloadj.version} 65 | 66 | 67 | 68 | org.apache.logging.log4j 69 | log4j-core 70 | ${log4j2.version} 71 | 72 | 73 | 74 | com.lmax 75 | disruptor 76 | 3.4.2 77 | 78 | 79 | 80 | junit 81 | junit 82 | 4.10 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | org.apache.maven.plugins 93 | maven-compiler-plugin 94 | ${java.compiler.plugin} 95 | 96 | ${jdk.target} 97 | 98 | 99 | 100 | 101 | org.apache.maven.plugins 102 | maven-shade-plugin 103 | 2.2 104 | 105 | 106 | package 107 | 108 | shade 109 | 110 | 111 | ${uberjar.name} 112 | 113 | 115 | org.openjdk.jmh.Main 116 | 117 | 118 | 119 | 120 | 121 | *:* 122 | 123 | META-INF/*.SF 124 | META-INF/*.DSA 125 | META-INF/*.RSA 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | maven-clean-plugin 139 | 2.5 140 | 141 | 142 | maven-deploy-plugin 143 | 2.8.1 144 | 145 | 146 | maven-install-plugin 147 | 2.5.1 148 | 149 | 150 | maven-jar-plugin 151 | 2.4 152 | 153 | 154 | maven-javadoc-plugin 155 | 2.9.1 156 | 157 | 158 | maven-resources-plugin 159 | 2.6 160 | 161 | 162 | maven-site-plugin 163 | 3.3 164 | 165 | 166 | maven-source-plugin 167 | 2.2.1 168 | 169 | 170 | maven-surefire-plugin 171 | 2.17 172 | 173 | 174 | 175 | 176 | 177 | 178 | -------------------------------------------------------------------------------- /results/herve-kvm-shared-L3/results-2021-08-27T2308-8.txt: -------------------------------------------------------------------------------- 1 | # JMH version: 1.29 2 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 3 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 4 | # VM options: 5 | # Blackhole mode: full + dont-inline hint 6 | # Warmup: 1 iterations, 10 s each 7 | # Measurement: 5 iterations, 4 s each 8 | # Timeout: 10 min per iteration 9 | # Threads: 8 threads, will synchronize iterations 10 | # Benchmark mode: Throughput, ops/time 11 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j1File 12 | 13 | # Run progress: 0.00% complete, ETA 00:03:00 14 | # Fork: 1 of 1 15 | # Warmup Iteration 1: 817.764 ops/ms 16 | Iteration 1: 815.941 ops/ms 17 | Iteration 2: 816.881 ops/ms 18 | Iteration 3: 803.939 ops/ms 19 | Iteration 4: 804.201 ops/ms 20 | Iteration 5: 804.092 ops/ms 21 | 22 | 23 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j1File": 24 | 809.011 ±(99.9%) 26.048 ops/ms [Average] 25 | (min, avg, max) = (803.939, 809.011, 816.881), stdev = 6.764 26 | CI (99.9%): [782.963, 835.059] (assumes normal distribution) 27 | 28 | 29 | # JMH version: 1.29 30 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 31 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 32 | # VM options: 33 | # Blackhole mode: full + dont-inline hint 34 | # Warmup: 1 iterations, 10 s each 35 | # Measurement: 5 iterations, 4 s each 36 | # Timeout: 10 min per iteration 37 | # Threads: 8 threads, will synchronize iterations 38 | # Benchmark mode: Throughput, ops/time 39 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j2AsyncFile 40 | 41 | # Run progress: 16.67% complete, ETA 00:02:34 42 | # Fork: 1 of 1 43 | # Warmup Iteration 1: 900.947 ops/ms 44 | Iteration 1: 885.444 ops/ms 45 | Iteration 2: 818.605 ops/ms 46 | Iteration 3: 844.859 ops/ms 47 | Iteration 4: 852.614 ops/ms 48 | Iteration 5: 864.022 ops/ms 49 | 50 | 51 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j2AsyncFile": 52 | 853.109 ±(99.9%) 94.782 ops/ms [Average] 53 | (min, avg, max) = (818.605, 853.109, 885.444), stdev = 24.615 54 | CI (99.9%): [758.327, 947.891] (assumes normal distribution) 55 | 56 | 57 | # JMH version: 1.29 58 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 59 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 60 | # VM options: 61 | # Blackhole mode: full + dont-inline hint 62 | # Warmup: 1 iterations, 10 s each 63 | # Measurement: 5 iterations, 4 s each 64 | # Timeout: 10 min per iteration 65 | # Threads: 8 threads, will synchronize iterations 66 | # Benchmark mode: Throughput, ops/time 67 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.logbackFile 68 | 69 | # Run progress: 33.33% complete, ETA 00:02:04 70 | # Fork: 1 of 1 71 | # Warmup Iteration 1: 860.951 ops/ms 72 | Iteration 1: 953.477 ops/ms 73 | Iteration 2: 968.400 ops/ms 74 | Iteration 3: 863.301 ops/ms 75 | Iteration 4: 982.960 ops/ms 76 | Iteration 5: 921.621 ops/ms 77 | 78 | 79 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.logbackFile": 80 | 937.952 ±(99.9%) 182.989 ops/ms [Average] 81 | (min, avg, max) = (863.301, 937.952, 982.960), stdev = 47.522 82 | CI (99.9%): [754.962, 1120.941] (assumes normal distribution) 83 | 84 | 85 | # JMH version: 1.29 86 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 87 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 88 | # VM options: 89 | # Blackhole mode: full + dont-inline hint 90 | # Warmup: 1 iterations, 10 s each 91 | # Measurement: 5 iterations, 4 s each 92 | # Timeout: 10 min per iteration 93 | # Threads: 8 threads, will synchronize iterations 94 | # Benchmark mode: Throughput, ops/time 95 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.log4j1File 96 | 97 | # Run progress: 50.00% complete, ETA 00:01:33 98 | # Fork: 1 of 1 99 | # Warmup Iteration 1: 621.390 ops/ms 100 | Iteration 1: 657.477 ops/ms 101 | Iteration 2: 694.628 ops/ms 102 | Iteration 3: 676.631 ops/ms 103 | Iteration 4: 602.672 ops/ms 104 | Iteration 5: 564.475 ops/ms 105 | 106 | 107 | Result "ch.qos.logback.perf.FileAppenderBenchmark.log4j1File": 108 | 639.177 ±(99.9%) 208.482 ops/ms [Average] 109 | (min, avg, max) = (564.475, 639.177, 694.628), stdev = 54.142 110 | CI (99.9%): [430.695, 847.659] (assumes normal distribution) 111 | 112 | 113 | # JMH version: 1.29 114 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 115 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 116 | # VM options: 117 | # Blackhole mode: full + dont-inline hint 118 | # Warmup: 1 iterations, 10 s each 119 | # Measurement: 5 iterations, 4 s each 120 | # Timeout: 10 min per iteration 121 | # Threads: 8 threads, will synchronize iterations 122 | # Benchmark mode: Throughput, ops/time 123 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.log4j2File 124 | 125 | # Run progress: 66.67% complete, ETA 00:01:02 126 | # Fork: 1 of 1 127 | # Warmup Iteration 1: 730.802 ops/ms 128 | Iteration 1: 862.511 ops/ms 129 | Iteration 2: 867.336 ops/ms 130 | Iteration 3: 849.219 ops/ms 131 | Iteration 4: 931.591 ops/ms 132 | Iteration 5: 763.224 ops/ms 133 | 134 | 135 | Result "ch.qos.logback.perf.FileAppenderBenchmark.log4j2File": 136 | 854.776 ±(99.9%) 232.086 ops/ms [Average] 137 | (min, avg, max) = (763.224, 854.776, 931.591), stdev = 60.272 138 | CI (99.9%): [622.691, 1086.862] (assumes normal distribution) 139 | 140 | 141 | # JMH version: 1.29 142 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 143 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 144 | # VM options: 145 | # Blackhole mode: full + dont-inline hint 146 | # Warmup: 1 iterations, 10 s each 147 | # Measurement: 5 iterations, 4 s each 148 | # Timeout: 10 min per iteration 149 | # Threads: 8 threads, will synchronize iterations 150 | # Benchmark mode: Throughput, ops/time 151 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.logbackFile 152 | 153 | # Run progress: 83.33% complete, ETA 00:00:31 154 | # Fork: 1 of 1 155 | # Warmup Iteration 1: 924.489 ops/ms 156 | Iteration 1: 909.089 ops/ms 157 | Iteration 2: 1124.155 ops/ms 158 | Iteration 3: 936.154 ops/ms 159 | Iteration 4: 810.497 ops/ms 160 | Iteration 5: 653.101 ops/ms 161 | 162 | 163 | Result "ch.qos.logback.perf.FileAppenderBenchmark.logbackFile": 164 | 886.599 ±(99.9%) 666.136 ops/ms [Average] 165 | (min, avg, max) = (653.101, 886.599, 1124.155), stdev = 172.993 166 | CI (99.9%): [220.463, 1552.735] (assumes normal distribution) 167 | 168 | 169 | # Run complete. Total time: 00:03:08 170 | 171 | REMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on 172 | why the numbers are the way they are. Use profilers (see -prof, -lprof), design factorial 173 | experiments, perform baseline and negative tests that provide experimental control, make sure 174 | the benchmarking environment is safe on JVM/OS/HW level, ask for reviews from the domain experts. 175 | Do not assume the numbers tell you what you want them to tell. 176 | 177 | Benchmark Mode Cnt Score Error Units 178 | AsyncWithFileAppenderBenchmark.log4j1File thrpt 5 809.011 ± 26.048 ops/ms 179 | AsyncWithFileAppenderBenchmark.log4j2AsyncFile thrpt 5 853.109 ± 94.782 ops/ms 180 | AsyncWithFileAppenderBenchmark.logbackFile thrpt 5 937.952 ± 182.989 ops/ms 181 | FileAppenderBenchmark.log4j1File thrpt 5 639.177 ± 208.482 ops/ms 182 | FileAppenderBenchmark.log4j2File thrpt 5 854.776 ± 232.086 ops/ms 183 | FileAppenderBenchmark.logbackFile thrpt 5 886.599 ± 666.136 ops/ms 184 | -------------------------------------------------------------------------------- /results/herve-kvm-shared-L3/results-2021-08-27T2308-16.txt: -------------------------------------------------------------------------------- 1 | # JMH version: 1.29 2 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 3 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 4 | # VM options: 5 | # Blackhole mode: full + dont-inline hint 6 | # Warmup: 1 iterations, 10 s each 7 | # Measurement: 5 iterations, 4 s each 8 | # Timeout: 10 min per iteration 9 | # Threads: 16 threads, will synchronize iterations 10 | # Benchmark mode: Throughput, ops/time 11 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j1File 12 | 13 | # Run progress: 0.00% complete, ETA 00:03:00 14 | # Fork: 1 of 1 15 | # Warmup Iteration 1: 521.566 ops/ms 16 | Iteration 1: 700.014 ops/ms 17 | Iteration 2: 573.789 ops/ms 18 | Iteration 3: 540.186 ops/ms 19 | Iteration 4: 617.068 ops/ms 20 | Iteration 5: 673.088 ops/ms 21 | 22 | 23 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j1File": 24 | 620.829 ±(99.9%) 256.374 ops/ms [Average] 25 | (min, avg, max) = (540.186, 620.829, 700.014), stdev = 66.580 26 | CI (99.9%): [364.455, 877.203] (assumes normal distribution) 27 | 28 | 29 | # JMH version: 1.29 30 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 31 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 32 | # VM options: 33 | # Blackhole mode: full + dont-inline hint 34 | # Warmup: 1 iterations, 10 s each 35 | # Measurement: 5 iterations, 4 s each 36 | # Timeout: 10 min per iteration 37 | # Threads: 16 threads, will synchronize iterations 38 | # Benchmark mode: Throughput, ops/time 39 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j2AsyncFile 40 | 41 | # Run progress: 16.67% complete, ETA 00:02:35 42 | # Fork: 1 of 1 43 | # Warmup Iteration 1: 698.406 ops/ms 44 | Iteration 1: 773.688 ops/ms 45 | Iteration 2: 746.132 ops/ms 46 | Iteration 3: 777.344 ops/ms 47 | Iteration 4: 785.493 ops/ms 48 | Iteration 5: 710.640 ops/ms 49 | 50 | 51 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j2AsyncFile": 52 | 758.659 ±(99.9%) 118.025 ops/ms [Average] 53 | (min, avg, max) = (710.640, 758.659, 785.493), stdev = 30.651 54 | CI (99.9%): [640.635, 876.684] (assumes normal distribution) 55 | 56 | 57 | # JMH version: 1.29 58 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 59 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 60 | # VM options: 61 | # Blackhole mode: full + dont-inline hint 62 | # Warmup: 1 iterations, 10 s each 63 | # Measurement: 5 iterations, 4 s each 64 | # Timeout: 10 min per iteration 65 | # Threads: 16 threads, will synchronize iterations 66 | # Benchmark mode: Throughput, ops/time 67 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.logbackFile 68 | 69 | # Run progress: 33.33% complete, ETA 00:02:05 70 | # Fork: 1 of 1 71 | # Warmup Iteration 1: 815.387 ops/ms 72 | Iteration 1: 929.811 ops/ms 73 | Iteration 2: 897.993 ops/ms 74 | Iteration 3: 804.516 ops/ms 75 | Iteration 4: 847.889 ops/ms 76 | Iteration 5: 765.861 ops/ms 77 | 78 | 79 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.logbackFile": 80 | 849.214 ±(99.9%) 257.033 ops/ms [Average] 81 | (min, avg, max) = (765.861, 849.214, 929.811), stdev = 66.751 82 | CI (99.9%): [592.180, 1106.247] (assumes normal distribution) 83 | 84 | 85 | # JMH version: 1.29 86 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 87 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 88 | # VM options: 89 | # Blackhole mode: full + dont-inline hint 90 | # Warmup: 1 iterations, 10 s each 91 | # Measurement: 5 iterations, 4 s each 92 | # Timeout: 10 min per iteration 93 | # Threads: 16 threads, will synchronize iterations 94 | # Benchmark mode: Throughput, ops/time 95 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.log4j1File 96 | 97 | # Run progress: 50.00% complete, ETA 00:01:34 98 | # Fork: 1 of 1 99 | # Warmup Iteration 1: 638.076 ops/ms 100 | Iteration 1: 709.235 ops/ms 101 | Iteration 2: 695.220 ops/ms 102 | Iteration 3: 702.504 ops/ms 103 | Iteration 4: 693.390 ops/ms 104 | Iteration 5: 713.474 ops/ms 105 | 106 | 107 | Result "ch.qos.logback.perf.FileAppenderBenchmark.log4j1File": 108 | 702.765 ±(99.9%) 33.427 ops/ms [Average] 109 | (min, avg, max) = (693.390, 702.765, 713.474), stdev = 8.681 110 | CI (99.9%): [669.338, 736.191] (assumes normal distribution) 111 | 112 | 113 | # JMH version: 1.29 114 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 115 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 116 | # VM options: 117 | # Blackhole mode: full + dont-inline hint 118 | # Warmup: 1 iterations, 10 s each 119 | # Measurement: 5 iterations, 4 s each 120 | # Timeout: 10 min per iteration 121 | # Threads: 16 threads, will synchronize iterations 122 | # Benchmark mode: Throughput, ops/time 123 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.log4j2File 124 | 125 | # Run progress: 66.67% complete, ETA 00:01:02 126 | # Fork: 1 of 1 127 | # Warmup Iteration 1: 877.955 ops/ms 128 | Iteration 1: 857.156 ops/ms 129 | Iteration 2: 887.273 ops/ms 130 | Iteration 3: 895.127 ops/ms 131 | Iteration 4: 885.576 ops/ms 132 | Iteration 5: 872.469 ops/ms 133 | 134 | 135 | Result "ch.qos.logback.perf.FileAppenderBenchmark.log4j2File": 136 | 879.520 ±(99.9%) 57.446 ops/ms [Average] 137 | (min, avg, max) = (857.156, 879.520, 895.127), stdev = 14.919 138 | CI (99.9%): [822.074, 936.966] (assumes normal distribution) 139 | 140 | 141 | # JMH version: 1.29 142 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 143 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 144 | # VM options: 145 | # Blackhole mode: full + dont-inline hint 146 | # Warmup: 1 iterations, 10 s each 147 | # Measurement: 5 iterations, 4 s each 148 | # Timeout: 10 min per iteration 149 | # Threads: 16 threads, will synchronize iterations 150 | # Benchmark mode: Throughput, ops/time 151 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.logbackFile 152 | 153 | # Run progress: 83.33% complete, ETA 00:00:31 154 | # Fork: 1 of 1 155 | # Warmup Iteration 1: 1067.560 ops/ms 156 | Iteration 1: 994.198 ops/ms 157 | Iteration 2: 969.835 ops/ms 158 | Iteration 3: 774.113 ops/ms 159 | Iteration 4: 961.369 ops/ms 160 | Iteration 5: 1067.027 ops/ms 161 | 162 | 163 | Result "ch.qos.logback.perf.FileAppenderBenchmark.logbackFile": 164 | 953.308 ±(99.9%) 417.636 ops/ms [Average] 165 | (min, avg, max) = (774.113, 953.308, 1067.027), stdev = 108.459 166 | CI (99.9%): [535.672, 1370.944] (assumes normal distribution) 167 | 168 | 169 | # Run complete. Total time: 00:03:07 170 | 171 | REMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on 172 | why the numbers are the way they are. Use profilers (see -prof, -lprof), design factorial 173 | experiments, perform baseline and negative tests that provide experimental control, make sure 174 | the benchmarking environment is safe on JVM/OS/HW level, ask for reviews from the domain experts. 175 | Do not assume the numbers tell you what you want them to tell. 176 | 177 | Benchmark Mode Cnt Score Error Units 178 | AsyncWithFileAppenderBenchmark.log4j1File thrpt 5 620.829 ± 256.374 ops/ms 179 | AsyncWithFileAppenderBenchmark.log4j2AsyncFile thrpt 5 758.659 ± 118.025 ops/ms 180 | AsyncWithFileAppenderBenchmark.logbackFile thrpt 5 849.214 ± 257.033 ops/ms 181 | FileAppenderBenchmark.log4j1File thrpt 5 702.765 ± 33.427 ops/ms 182 | FileAppenderBenchmark.log4j2File thrpt 5 879.520 ± 57.446 ops/ms 183 | FileAppenderBenchmark.logbackFile thrpt 5 953.308 ± 417.636 ops/ms 184 | -------------------------------------------------------------------------------- /results/herve-kvm-shared-L3/results-2021-08-27T2308-32.txt: -------------------------------------------------------------------------------- 1 | # JMH version: 1.29 2 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 3 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 4 | # VM options: 5 | # Blackhole mode: full + dont-inline hint 6 | # Warmup: 1 iterations, 10 s each 7 | # Measurement: 5 iterations, 4 s each 8 | # Timeout: 10 min per iteration 9 | # Threads: 32 threads, will synchronize iterations 10 | # Benchmark mode: Throughput, ops/time 11 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j1File 12 | 13 | # Run progress: 0.00% complete, ETA 00:03:00 14 | # Fork: 1 of 1 15 | # Warmup Iteration 1: 697.608 ops/ms 16 | Iteration 1: 613.191 ops/ms 17 | Iteration 2: 568.743 ops/ms 18 | Iteration 3: 586.643 ops/ms 19 | Iteration 4: 683.200 ops/ms 20 | Iteration 5: 675.349 ops/ms 21 | 22 | 23 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j1File": 24 | 625.425 ±(99.9%) 199.128 ops/ms [Average] 25 | (min, avg, max) = (568.743, 625.425, 683.200), stdev = 51.713 26 | CI (99.9%): [426.298, 824.553] (assumes normal distribution) 27 | 28 | 29 | # JMH version: 1.29 30 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 31 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 32 | # VM options: 33 | # Blackhole mode: full + dont-inline hint 34 | # Warmup: 1 iterations, 10 s each 35 | # Measurement: 5 iterations, 4 s each 36 | # Timeout: 10 min per iteration 37 | # Threads: 32 threads, will synchronize iterations 38 | # Benchmark mode: Throughput, ops/time 39 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j2AsyncFile 40 | 41 | # Run progress: 16.67% complete, ETA 00:02:35 42 | # Fork: 1 of 1 43 | # Warmup Iteration 1: 719.419 ops/ms 44 | Iteration 1: 723.443 ops/ms 45 | Iteration 2: 789.681 ops/ms 46 | Iteration 3: 881.787 ops/ms 47 | Iteration 4: 855.786 ops/ms 48 | Iteration 5: 705.674 ops/ms 49 | 50 | 51 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j2AsyncFile": 52 | 791.274 ±(99.9%) 300.038 ops/ms [Average] 53 | (min, avg, max) = (705.674, 791.274, 881.787), stdev = 77.919 54 | CI (99.9%): [491.236, 1091.312] (assumes normal distribution) 55 | 56 | 57 | # JMH version: 1.29 58 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 59 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 60 | # VM options: 61 | # Blackhole mode: full + dont-inline hint 62 | # Warmup: 1 iterations, 10 s each 63 | # Measurement: 5 iterations, 4 s each 64 | # Timeout: 10 min per iteration 65 | # Threads: 32 threads, will synchronize iterations 66 | # Benchmark mode: Throughput, ops/time 67 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.logbackFile 68 | 69 | # Run progress: 33.33% complete, ETA 00:02:05 70 | # Fork: 1 of 1 71 | # Warmup Iteration 1: 640.390 ops/ms 72 | Iteration 1: 672.409 ops/ms 73 | Iteration 2: 734.479 ops/ms 74 | Iteration 3: 587.456 ops/ms 75 | Iteration 4: 618.107 ops/ms 76 | Iteration 5: 736.271 ops/ms 77 | 78 | 79 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.logbackFile": 80 | 669.745 ±(99.9%) 258.748 ops/ms [Average] 81 | (min, avg, max) = (587.456, 669.745, 736.271), stdev = 67.196 82 | CI (99.9%): [410.997, 928.492] (assumes normal distribution) 83 | 84 | 85 | # JMH version: 1.29 86 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 87 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 88 | # VM options: 89 | # Blackhole mode: full + dont-inline hint 90 | # Warmup: 1 iterations, 10 s each 91 | # Measurement: 5 iterations, 4 s each 92 | # Timeout: 10 min per iteration 93 | # Threads: 32 threads, will synchronize iterations 94 | # Benchmark mode: Throughput, ops/time 95 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.log4j1File 96 | 97 | # Run progress: 50.00% complete, ETA 00:01:34 98 | # Fork: 1 of 1 99 | # Warmup Iteration 1: 580.353 ops/ms 100 | Iteration 1: 623.331 ops/ms 101 | Iteration 2: 643.357 ops/ms 102 | Iteration 3: 655.297 ops/ms 103 | Iteration 4: 636.966 ops/ms 104 | Iteration 5: 633.926 ops/ms 105 | 106 | 107 | Result "ch.qos.logback.perf.FileAppenderBenchmark.log4j1File": 108 | 638.575 ±(99.9%) 45.524 ops/ms [Average] 109 | (min, avg, max) = (623.331, 638.575, 655.297), stdev = 11.822 110 | CI (99.9%): [593.051, 684.099] (assumes normal distribution) 111 | 112 | 113 | # JMH version: 1.29 114 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 115 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 116 | # VM options: 117 | # Blackhole mode: full + dont-inline hint 118 | # Warmup: 1 iterations, 10 s each 119 | # Measurement: 5 iterations, 4 s each 120 | # Timeout: 10 min per iteration 121 | # Threads: 32 threads, will synchronize iterations 122 | # Benchmark mode: Throughput, ops/time 123 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.log4j2File 124 | 125 | # Run progress: 66.67% complete, ETA 00:01:03 126 | # Fork: 1 of 1 127 | # Warmup Iteration 1: 849.075 ops/ms 128 | Iteration 1: 733.885 ops/ms 129 | Iteration 2: 719.873 ops/ms 130 | Iteration 3: 614.515 ops/ms 131 | Iteration 4: 717.630 ops/ms 132 | Iteration 5: 772.941 ops/ms 133 | 134 | 135 | Result "ch.qos.logback.perf.FileAppenderBenchmark.log4j2File": 136 | 711.769 ±(99.9%) 226.089 ops/ms [Average] 137 | (min, avg, max) = (614.515, 711.769, 772.941), stdev = 58.714 138 | CI (99.9%): [485.680, 937.858] (assumes normal distribution) 139 | 140 | 141 | # JMH version: 1.29 142 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 143 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 144 | # VM options: 145 | # Blackhole mode: full + dont-inline hint 146 | # Warmup: 1 iterations, 10 s each 147 | # Measurement: 5 iterations, 4 s each 148 | # Timeout: 10 min per iteration 149 | # Threads: 32 threads, will synchronize iterations 150 | # Benchmark mode: Throughput, ops/time 151 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.logbackFile 152 | 153 | # Run progress: 83.33% complete, ETA 00:00:31 154 | # Fork: 1 of 1 155 | # Warmup Iteration 1: 1123.505 ops/ms 156 | Iteration 1: 872.986 ops/ms 157 | Iteration 2: 924.576 ops/ms 158 | Iteration 3: 824.930 ops/ms 159 | Iteration 4: 996.811 ops/ms 160 | Iteration 5: 1105.369 ops/ms 161 | 162 | 163 | Result "ch.qos.logback.perf.FileAppenderBenchmark.logbackFile": 164 | 944.934 ±(99.9%) 423.669 ops/ms [Average] 165 | (min, avg, max) = (824.930, 944.934, 1105.369), stdev = 110.026 166 | CI (99.9%): [521.265, 1368.604] (assumes normal distribution) 167 | 168 | 169 | # Run complete. Total time: 00:03:09 170 | 171 | REMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on 172 | why the numbers are the way they are. Use profilers (see -prof, -lprof), design factorial 173 | experiments, perform baseline and negative tests that provide experimental control, make sure 174 | the benchmarking environment is safe on JVM/OS/HW level, ask for reviews from the domain experts. 175 | Do not assume the numbers tell you what you want them to tell. 176 | 177 | Benchmark Mode Cnt Score Error Units 178 | AsyncWithFileAppenderBenchmark.log4j1File thrpt 5 625.425 ± 199.128 ops/ms 179 | AsyncWithFileAppenderBenchmark.log4j2AsyncFile thrpt 5 791.274 ± 300.038 ops/ms 180 | AsyncWithFileAppenderBenchmark.logbackFile thrpt 5 669.745 ± 258.748 ops/ms 181 | FileAppenderBenchmark.log4j1File thrpt 5 638.575 ± 45.524 ops/ms 182 | FileAppenderBenchmark.log4j2File thrpt 5 711.769 ± 226.089 ops/ms 183 | FileAppenderBenchmark.logbackFile thrpt 5 944.934 ± 423.669 ops/ms 184 | -------------------------------------------------------------------------------- /results/herve-kvm-shared-L3/results-2021-08-27T2308-64.txt: -------------------------------------------------------------------------------- 1 | # JMH version: 1.29 2 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 3 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 4 | # VM options: 5 | # Blackhole mode: full + dont-inline hint 6 | # Warmup: 1 iterations, 10 s each 7 | # Measurement: 5 iterations, 4 s each 8 | # Timeout: 10 min per iteration 9 | # Threads: 64 threads, will synchronize iterations 10 | # Benchmark mode: Throughput, ops/time 11 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j1File 12 | 13 | # Run progress: 0.00% complete, ETA 00:03:00 14 | # Fork: 1 of 1 15 | # Warmup Iteration 1: 783.000 ops/ms 16 | Iteration 1: 776.057 ops/ms 17 | Iteration 2: 786.175 ops/ms 18 | Iteration 3: 774.612 ops/ms 19 | Iteration 4: 784.400 ops/ms 20 | Iteration 5: 774.761 ops/ms 21 | 22 | 23 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j1File": 24 | 779.201 ±(99.9%) 21.640 ops/ms [Average] 25 | (min, avg, max) = (774.612, 779.201, 786.175), stdev = 5.620 26 | CI (99.9%): [757.561, 800.840] (assumes normal distribution) 27 | 28 | 29 | # JMH version: 1.29 30 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 31 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 32 | # VM options: 33 | # Blackhole mode: full + dont-inline hint 34 | # Warmup: 1 iterations, 10 s each 35 | # Measurement: 5 iterations, 4 s each 36 | # Timeout: 10 min per iteration 37 | # Threads: 64 threads, will synchronize iterations 38 | # Benchmark mode: Throughput, ops/time 39 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j2AsyncFile 40 | 41 | # Run progress: 16.67% complete, ETA 00:02:35 42 | # Fork: 1 of 1 43 | # Warmup Iteration 1: 751.208 ops/ms 44 | Iteration 1: 802.770 ops/ms 45 | Iteration 2: 849.813 ops/ms 46 | Iteration 3: 720.960 ops/ms 47 | Iteration 4: 767.950 ops/ms 48 | Iteration 5: 656.766 ops/ms 49 | 50 | 51 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j2AsyncFile": 52 | 759.652 ±(99.9%) 286.476 ops/ms [Average] 53 | (min, avg, max) = (656.766, 759.652, 849.813), stdev = 74.397 54 | CI (99.9%): [473.176, 1046.128] (assumes normal distribution) 55 | 56 | 57 | # JMH version: 1.29 58 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 59 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 60 | # VM options: 61 | # Blackhole mode: full + dont-inline hint 62 | # Warmup: 1 iterations, 10 s each 63 | # Measurement: 5 iterations, 4 s each 64 | # Timeout: 10 min per iteration 65 | # Threads: 64 threads, will synchronize iterations 66 | # Benchmark mode: Throughput, ops/time 67 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.logbackFile 68 | 69 | # Run progress: 33.33% complete, ETA 00:02:05 70 | # Fork: 1 of 1 71 | # Warmup Iteration 1: 607.560 ops/ms 72 | Iteration 1: 671.308 ops/ms 73 | Iteration 2: 664.038 ops/ms 74 | Iteration 3: 601.043 ops/ms 75 | Iteration 4: 675.924 ops/ms 76 | Iteration 5: 755.810 ops/ms 77 | 78 | 79 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.logbackFile": 80 | 673.625 ±(99.9%) 212.005 ops/ms [Average] 81 | (min, avg, max) = (601.043, 673.625, 755.810), stdev = 55.057 82 | CI (99.9%): [461.619, 885.630] (assumes normal distribution) 83 | 84 | 85 | # JMH version: 1.29 86 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 87 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 88 | # VM options: 89 | # Blackhole mode: full + dont-inline hint 90 | # Warmup: 1 iterations, 10 s each 91 | # Measurement: 5 iterations, 4 s each 92 | # Timeout: 10 min per iteration 93 | # Threads: 64 threads, will synchronize iterations 94 | # Benchmark mode: Throughput, ops/time 95 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.log4j1File 96 | 97 | # Run progress: 50.00% complete, ETA 00:01:35 98 | # Fork: 1 of 1 99 | # Warmup Iteration 1: 667.025 ops/ms 100 | Iteration 1: 670.491 ops/ms 101 | Iteration 2: 665.905 ops/ms 102 | Iteration 3: 652.880 ops/ms 103 | Iteration 4: 580.159 ops/ms 104 | Iteration 5: 586.554 ops/ms 105 | 106 | 107 | Result "ch.qos.logback.perf.FileAppenderBenchmark.log4j1File": 108 | 631.198 ±(99.9%) 170.221 ops/ms [Average] 109 | (min, avg, max) = (580.159, 631.198, 670.491), stdev = 44.206 110 | CI (99.9%): [460.977, 801.419] (assumes normal distribution) 111 | 112 | 113 | # JMH version: 1.29 114 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 115 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 116 | # VM options: 117 | # Blackhole mode: full + dont-inline hint 118 | # Warmup: 1 iterations, 10 s each 119 | # Measurement: 5 iterations, 4 s each 120 | # Timeout: 10 min per iteration 121 | # Threads: 64 threads, will synchronize iterations 122 | # Benchmark mode: Throughput, ops/time 123 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.log4j2File 124 | 125 | # Run progress: 66.67% complete, ETA 00:01:03 126 | # Fork: 1 of 1 127 | # Warmup Iteration 1: 779.851 ops/ms 128 | Iteration 1: 764.881 ops/ms 129 | Iteration 2: 811.159 ops/ms 130 | Iteration 3: 657.894 ops/ms 131 | Iteration 4: 724.272 ops/ms 132 | Iteration 5: 808.254 ops/ms 133 | 134 | 135 | Result "ch.qos.logback.perf.FileAppenderBenchmark.log4j2File": 136 | 753.292 ±(99.9%) 246.913 ops/ms [Average] 137 | (min, avg, max) = (657.894, 753.292, 811.159), stdev = 64.122 138 | CI (99.9%): [506.379, 1000.204] (assumes normal distribution) 139 | 140 | 141 | # JMH version: 1.29 142 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 143 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 144 | # VM options: 145 | # Blackhole mode: full + dont-inline hint 146 | # Warmup: 1 iterations, 10 s each 147 | # Measurement: 5 iterations, 4 s each 148 | # Timeout: 10 min per iteration 149 | # Threads: 64 threads, will synchronize iterations 150 | # Benchmark mode: Throughput, ops/time 151 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.logbackFile 152 | 153 | # Run progress: 83.33% complete, ETA 00:00:31 154 | # Fork: 1 of 1 155 | # Warmup Iteration 1: 896.992 ops/ms 156 | Iteration 1: 993.535 ops/ms 157 | Iteration 2: 981.114 ops/ms 158 | Iteration 3: 1067.873 ops/ms 159 | Iteration 4: 969.625 ops/ms 160 | Iteration 5: 1000.627 ops/ms 161 | 162 | 163 | Result "ch.qos.logback.perf.FileAppenderBenchmark.logbackFile": 164 | 1002.555 ±(99.9%) 147.833 ops/ms [Average] 165 | (min, avg, max) = (969.625, 1002.555, 1067.873), stdev = 38.392 166 | CI (99.9%): [854.722, 1150.388] (assumes normal distribution) 167 | 168 | 169 | # Run complete. Total time: 00:03:09 170 | 171 | REMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on 172 | why the numbers are the way they are. Use profilers (see -prof, -lprof), design factorial 173 | experiments, perform baseline and negative tests that provide experimental control, make sure 174 | the benchmarking environment is safe on JVM/OS/HW level, ask for reviews from the domain experts. 175 | Do not assume the numbers tell you what you want them to tell. 176 | 177 | Benchmark Mode Cnt Score Error Units 178 | AsyncWithFileAppenderBenchmark.log4j1File thrpt 5 779.201 ± 21.640 ops/ms 179 | AsyncWithFileAppenderBenchmark.log4j2AsyncFile thrpt 5 759.652 ± 286.476 ops/ms 180 | AsyncWithFileAppenderBenchmark.logbackFile thrpt 5 673.625 ± 212.005 ops/ms 181 | FileAppenderBenchmark.log4j1File thrpt 5 631.198 ± 170.221 ops/ms 182 | FileAppenderBenchmark.log4j2File thrpt 5 753.292 ± 246.913 ops/ms 183 | FileAppenderBenchmark.logbackFile thrpt 5 1002.555 ± 147.833 ops/ms 184 | -------------------------------------------------------------------------------- /results/herve-kvm-shared-L3/results-2021-08-27T2308-4.txt: -------------------------------------------------------------------------------- 1 | # JMH version: 1.29 2 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 3 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 4 | # VM options: 5 | # Blackhole mode: full + dont-inline hint 6 | # Warmup: 1 iterations, 10 s each 7 | # Measurement: 5 iterations, 4 s each 8 | # Timeout: 10 min per iteration 9 | # Threads: 4 threads, will synchronize iterations 10 | # Benchmark mode: Throughput, ops/time 11 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j1File 12 | 13 | # Run progress: 0.00% complete, ETA 00:03:00 14 | # Fork: 1 of 1 15 | # Warmup Iteration 1: 547.348 ops/ms 16 | Iteration 1: 709.932 ops/ms 17 | Iteration 2: 714.869 ops/ms 18 | Iteration 3: 770.297 ops/ms 19 | Iteration 4: 588.279 ops/ms 20 | Iteration 5: 531.277 ops/ms 21 | 22 | 23 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j1File": 24 | 662.931 ±(99.9%) 381.874 ops/ms [Average] 25 | (min, avg, max) = (531.277, 662.931, 770.297), stdev = 99.171 26 | CI (99.9%): [281.057, 1044.805] (assumes normal distribution) 27 | 28 | 29 | # JMH version: 1.29 30 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 31 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 32 | # VM options: 33 | # Blackhole mode: full + dont-inline hint 34 | # Warmup: 1 iterations, 10 s each 35 | # Measurement: 5 iterations, 4 s each 36 | # Timeout: 10 min per iteration 37 | # Threads: 4 threads, will synchronize iterations 38 | # Benchmark mode: Throughput, ops/time 39 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j2AsyncFile 40 | 41 | # Run progress: 16.67% complete, ETA 00:02:34 42 | # Fork: 1 of 1 43 | # Warmup Iteration 1: 846.905 ops/ms 44 | Iteration 1: 909.715 ops/ms 45 | Iteration 2: 881.823 ops/ms 46 | Iteration 3: 924.904 ops/ms 47 | Iteration 4: 857.643 ops/ms 48 | Iteration 5: 879.254 ops/ms 49 | 50 | 51 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j2AsyncFile": 52 | 890.668 ±(99.9%) 102.496 ops/ms [Average] 53 | (min, avg, max) = (857.643, 890.668, 924.904), stdev = 26.618 54 | CI (99.9%): [788.172, 993.164] (assumes normal distribution) 55 | 56 | 57 | # JMH version: 1.29 58 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 59 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 60 | # VM options: 61 | # Blackhole mode: full + dont-inline hint 62 | # Warmup: 1 iterations, 10 s each 63 | # Measurement: 5 iterations, 4 s each 64 | # Timeout: 10 min per iteration 65 | # Threads: 4 threads, will synchronize iterations 66 | # Benchmark mode: Throughput, ops/time 67 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.logbackFile 68 | 69 | # Run progress: 33.33% complete, ETA 00:02:06 70 | # Fork: 1 of 1 71 | # Warmup Iteration 1: 1225.704 ops/ms 72 | Iteration 1: 1194.030 ops/ms 73 | Iteration 2: 1065.590 ops/ms 74 | Iteration 3: 1084.340 ops/ms 75 | Iteration 4: 1174.538 ops/ms 76 | Iteration 5: 1230.903 ops/ms 77 | 78 | 79 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.logbackFile": 80 | 1149.880 ±(99.9%) 275.814 ops/ms [Average] 81 | (min, avg, max) = (1065.590, 1149.880, 1230.903), stdev = 71.628 82 | CI (99.9%): [874.066, 1425.694] (assumes normal distribution) 83 | 84 | 85 | # JMH version: 1.29 86 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 87 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 88 | # VM options: 89 | # Blackhole mode: full + dont-inline hint 90 | # Warmup: 1 iterations, 10 s each 91 | # Measurement: 5 iterations, 4 s each 92 | # Timeout: 10 min per iteration 93 | # Threads: 4 threads, will synchronize iterations 94 | # Benchmark mode: Throughput, ops/time 95 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.log4j1File 96 | 97 | # Run progress: 50.00% complete, ETA 00:01:34 98 | # Fork: 1 of 1 99 | # Warmup Iteration 1: 725.206 ops/ms 100 | Iteration 1: 729.375 ops/ms 101 | Iteration 2: 697.010 ops/ms 102 | Iteration 3: 701.533 ops/ms 103 | Iteration 4: 702.633 ops/ms 104 | Iteration 5: 721.270 ops/ms 105 | 106 | 107 | Result "ch.qos.logback.perf.FileAppenderBenchmark.log4j1File": 108 | 710.364 ±(99.9%) 54.334 ops/ms [Average] 109 | (min, avg, max) = (697.010, 710.364, 729.375), stdev = 14.110 110 | CI (99.9%): [656.030, 764.699] (assumes normal distribution) 111 | 112 | 113 | # JMH version: 1.29 114 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 115 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 116 | # VM options: 117 | # Blackhole mode: full + dont-inline hint 118 | # Warmup: 1 iterations, 10 s each 119 | # Measurement: 5 iterations, 4 s each 120 | # Timeout: 10 min per iteration 121 | # Threads: 4 threads, will synchronize iterations 122 | # Benchmark mode: Throughput, ops/time 123 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.log4j2File 124 | 125 | # Run progress: 66.67% complete, ETA 00:01:03 126 | # Fork: 1 of 1 127 | # Warmup Iteration 1: 1051.983 ops/ms 128 | Iteration 1: 1054.588 ops/ms 129 | Iteration 2: 1069.495 ops/ms 130 | Iteration 3: 1100.111 ops/ms 131 | Iteration 4: 1090.470 ops/ms 132 | Iteration 5: 1081.918 ops/ms 133 | 134 | 135 | Result "ch.qos.logback.perf.FileAppenderBenchmark.log4j2File": 136 | 1079.316 ±(99.9%) 68.655 ops/ms [Average] 137 | (min, avg, max) = (1054.588, 1079.316, 1100.111), stdev = 17.830 138 | CI (99.9%): [1010.661, 1147.972] (assumes normal distribution) 139 | 140 | 141 | # JMH version: 1.29 142 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 143 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 144 | # VM options: 145 | # Blackhole mode: full + dont-inline hint 146 | # Warmup: 1 iterations, 10 s each 147 | # Measurement: 5 iterations, 4 s each 148 | # Timeout: 10 min per iteration 149 | # Threads: 4 threads, will synchronize iterations 150 | # Benchmark mode: Throughput, ops/time 151 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.logbackFile 152 | 153 | # Run progress: 83.33% complete, ETA 00:00:31 154 | # Fork: 1 of 1 155 | # Warmup Iteration 1: 1222.565 ops/ms 156 | Iteration 1: 1228.159 ops/ms 157 | Iteration 2: 1213.916 ops/ms 158 | Iteration 3: 1207.499 ops/ms 159 | Iteration 4: 1201.857 ops/ms 160 | Iteration 5: 1209.370 ops/ms 161 | 162 | 163 | Result "ch.qos.logback.perf.FileAppenderBenchmark.logbackFile": 164 | 1212.160 ±(99.9%) 38.251 ops/ms [Average] 165 | (min, avg, max) = (1201.857, 1212.160, 1228.159), stdev = 9.934 166 | CI (99.9%): [1173.909, 1250.411] (assumes normal distribution) 167 | 168 | 169 | # Run complete. Total time: 00:03:08 170 | 171 | REMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on 172 | why the numbers are the way they are. Use profilers (see -prof, -lprof), design factorial 173 | experiments, perform baseline and negative tests that provide experimental control, make sure 174 | the benchmarking environment is safe on JVM/OS/HW level, ask for reviews from the domain experts. 175 | Do not assume the numbers tell you what you want them to tell. 176 | 177 | Benchmark Mode Cnt Score Error Units 178 | AsyncWithFileAppenderBenchmark.log4j1File thrpt 5 662.931 ± 381.874 ops/ms 179 | AsyncWithFileAppenderBenchmark.log4j2AsyncFile thrpt 5 890.668 ± 102.496 ops/ms 180 | AsyncWithFileAppenderBenchmark.logbackFile thrpt 5 1149.880 ± 275.814 ops/ms 181 | FileAppenderBenchmark.log4j1File thrpt 5 710.364 ± 54.334 ops/ms 182 | FileAppenderBenchmark.log4j2File thrpt 5 1079.316 ± 68.655 ops/ms 183 | FileAppenderBenchmark.logbackFile thrpt 5 1212.160 ± 38.251 ops/ms 184 | -------------------------------------------------------------------------------- /results/herve-kvm-shared-L3/results-2021-08-27T2308-2.txt: -------------------------------------------------------------------------------- 1 | # JMH version: 1.29 2 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 3 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 4 | # VM options: 5 | # Blackhole mode: full + dont-inline hint 6 | # Warmup: 1 iterations, 10 s each 7 | # Measurement: 5 iterations, 4 s each 8 | # Timeout: 10 min per iteration 9 | # Threads: 2 threads, will synchronize iterations 10 | # Benchmark mode: Throughput, ops/time 11 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j1File 12 | 13 | # Run progress: 0.00% complete, ETA 00:03:00 14 | # Fork: 1 of 1 15 | # Warmup Iteration 1: 818.835 ops/ms 16 | Iteration 1: 848.245 ops/ms 17 | Iteration 2: 844.376 ops/ms 18 | Iteration 3: 845.531 ops/ms 19 | Iteration 4: 834.017 ops/ms 20 | Iteration 5: 812.915 ops/ms 21 | 22 | 23 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j1File": 24 | 837.017 ±(99.9%) 55.887 ops/ms [Average] 25 | (min, avg, max) = (812.915, 837.017, 848.245), stdev = 14.514 26 | CI (99.9%): [781.129, 892.904] (assumes normal distribution) 27 | 28 | 29 | # JMH version: 1.29 30 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 31 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 32 | # VM options: 33 | # Blackhole mode: full + dont-inline hint 34 | # Warmup: 1 iterations, 10 s each 35 | # Measurement: 5 iterations, 4 s each 36 | # Timeout: 10 min per iteration 37 | # Threads: 2 threads, will synchronize iterations 38 | # Benchmark mode: Throughput, ops/time 39 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j2AsyncFile 40 | 41 | # Run progress: 16.67% complete, ETA 00:02:34 42 | # Fork: 1 of 1 43 | # Warmup Iteration 1: 988.983 ops/ms 44 | Iteration 1: 1004.049 ops/ms 45 | Iteration 2: 987.493 ops/ms 46 | Iteration 3: 1003.452 ops/ms 47 | Iteration 4: 1019.761 ops/ms 48 | Iteration 5: 910.413 ops/ms 49 | 50 | 51 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j2AsyncFile": 52 | 985.033 ±(99.9%) 166.528 ops/ms [Average] 53 | (min, avg, max) = (910.413, 985.033, 1019.761), stdev = 43.247 54 | CI (99.9%): [818.506, 1151.561] (assumes normal distribution) 55 | 56 | 57 | # JMH version: 1.29 58 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 59 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 60 | # VM options: 61 | # Blackhole mode: full + dont-inline hint 62 | # Warmup: 1 iterations, 10 s each 63 | # Measurement: 5 iterations, 4 s each 64 | # Timeout: 10 min per iteration 65 | # Threads: 2 threads, will synchronize iterations 66 | # Benchmark mode: Throughput, ops/time 67 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.logbackFile 68 | 69 | # Run progress: 33.33% complete, ETA 00:02:04 70 | # Fork: 1 of 1 71 | # Warmup Iteration 1: 1411.154 ops/ms 72 | Iteration 1: 1502.897 ops/ms 73 | Iteration 2: 1495.022 ops/ms 74 | Iteration 3: 1451.469 ops/ms 75 | Iteration 4: 1501.136 ops/ms 76 | Iteration 5: 1467.304 ops/ms 77 | 78 | 79 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.logbackFile": 80 | 1483.566 ±(99.9%) 88.404 ops/ms [Average] 81 | (min, avg, max) = (1451.469, 1483.566, 1502.897), stdev = 22.958 82 | CI (99.9%): [1395.162, 1571.969] (assumes normal distribution) 83 | 84 | 85 | # JMH version: 1.29 86 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 87 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 88 | # VM options: 89 | # Blackhole mode: full + dont-inline hint 90 | # Warmup: 1 iterations, 10 s each 91 | # Measurement: 5 iterations, 4 s each 92 | # Timeout: 10 min per iteration 93 | # Threads: 2 threads, will synchronize iterations 94 | # Benchmark mode: Throughput, ops/time 95 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.log4j1File 96 | 97 | # Run progress: 50.00% complete, ETA 00:01:33 98 | # Fork: 1 of 1 99 | # Warmup Iteration 1: 759.821 ops/ms 100 | Iteration 1: 767.588 ops/ms 101 | Iteration 2: 774.990 ops/ms 102 | Iteration 3: 773.460 ops/ms 103 | Iteration 4: 770.232 ops/ms 104 | Iteration 5: 749.561 ops/ms 105 | 106 | 107 | Result "ch.qos.logback.perf.FileAppenderBenchmark.log4j1File": 108 | 767.166 ±(99.9%) 39.473 ops/ms [Average] 109 | (min, avg, max) = (749.561, 767.166, 774.990), stdev = 10.251 110 | CI (99.9%): [727.693, 806.639] (assumes normal distribution) 111 | 112 | 113 | # JMH version: 1.29 114 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 115 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 116 | # VM options: 117 | # Blackhole mode: full + dont-inline hint 118 | # Warmup: 1 iterations, 10 s each 119 | # Measurement: 5 iterations, 4 s each 120 | # Timeout: 10 min per iteration 121 | # Threads: 2 threads, will synchronize iterations 122 | # Benchmark mode: Throughput, ops/time 123 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.log4j2File 124 | 125 | # Run progress: 66.67% complete, ETA 00:01:02 126 | # Fork: 1 of 1 127 | # Warmup Iteration 1: 1396.905 ops/ms 128 | Iteration 1: 1455.149 ops/ms 129 | Iteration 2: 1262.029 ops/ms 130 | Iteration 3: 1270.929 ops/ms 131 | Iteration 4: 1428.821 ops/ms 132 | Iteration 5: 1185.588 ops/ms 133 | 134 | 135 | Result "ch.qos.logback.perf.FileAppenderBenchmark.log4j2File": 136 | 1320.503 ±(99.9%) 447.160 ops/ms [Average] 137 | (min, avg, max) = (1185.588, 1320.503, 1455.149), stdev = 116.126 138 | CI (99.9%): [873.343, 1767.663] (assumes normal distribution) 139 | 140 | 141 | # JMH version: 1.29 142 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 143 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 144 | # VM options: 145 | # Blackhole mode: full + dont-inline hint 146 | # Warmup: 1 iterations, 10 s each 147 | # Measurement: 5 iterations, 4 s each 148 | # Timeout: 10 min per iteration 149 | # Threads: 2 threads, will synchronize iterations 150 | # Benchmark mode: Throughput, ops/time 151 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.logbackFile 152 | 153 | # Run progress: 83.33% complete, ETA 00:00:31 154 | # Fork: 1 of 1 155 | # Warmup Iteration 1: 1660.089 ops/ms 156 | Iteration 1: 1286.411 ops/ms 157 | Iteration 2: 1262.665 ops/ms 158 | Iteration 3: 1281.940 ops/ms 159 | Iteration 4: 1818.299 ops/ms 160 | Iteration 5: 1438.674 ops/ms 161 | 162 | 163 | Result "ch.qos.logback.perf.FileAppenderBenchmark.logbackFile": 164 | 1417.598 ±(99.9%) 904.333 ops/ms [Average] 165 | (min, avg, max) = (1262.665, 1417.598, 1818.299), stdev = 234.852 166 | CI (99.9%): [513.264, 2321.931] (assumes normal distribution) 167 | 168 | 169 | # Run complete. Total time: 00:03:07 170 | 171 | REMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on 172 | why the numbers are the way they are. Use profilers (see -prof, -lprof), design factorial 173 | experiments, perform baseline and negative tests that provide experimental control, make sure 174 | the benchmarking environment is safe on JVM/OS/HW level, ask for reviews from the domain experts. 175 | Do not assume the numbers tell you what you want them to tell. 176 | 177 | Benchmark Mode Cnt Score Error Units 178 | AsyncWithFileAppenderBenchmark.log4j1File thrpt 5 837.017 ± 55.887 ops/ms 179 | AsyncWithFileAppenderBenchmark.log4j2AsyncFile thrpt 5 985.033 ± 166.528 ops/ms 180 | AsyncWithFileAppenderBenchmark.logbackFile thrpt 5 1483.566 ± 88.404 ops/ms 181 | FileAppenderBenchmark.log4j1File thrpt 5 767.166 ± 39.473 ops/ms 182 | FileAppenderBenchmark.log4j2File thrpt 5 1320.503 ± 447.160 ops/ms 183 | FileAppenderBenchmark.logbackFile thrpt 5 1417.598 ± 904.333 ops/ms 184 | -------------------------------------------------------------------------------- /results/herve-kvm-shared-L3/results-2021-08-27T2308-1.txt: -------------------------------------------------------------------------------- 1 | # JMH version: 1.29 2 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 3 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 4 | # VM options: 5 | # Blackhole mode: full + dont-inline hint 6 | # Warmup: 1 iterations, 10 s each 7 | # Measurement: 5 iterations, 4 s each 8 | # Timeout: 10 min per iteration 9 | # Threads: 1 thread, will synchronize iterations 10 | # Benchmark mode: Throughput, ops/time 11 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j1File 12 | 13 | # Run progress: 0.00% complete, ETA 00:03:00 14 | # Fork: 1 of 1 15 | # Warmup Iteration 1: 608.580 ops/ms 16 | Iteration 1: 733.489 ops/ms 17 | Iteration 2: 686.755 ops/ms 18 | Iteration 3: 690.712 ops/ms 19 | Iteration 4: 723.876 ops/ms 20 | Iteration 5: 654.707 ops/ms 21 | 22 | 23 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j1File": 24 | 697.908 ±(99.9%) 121.507 ops/ms [Average] 25 | (min, avg, max) = (654.707, 697.908, 733.489), stdev = 31.555 26 | CI (99.9%): [576.401, 819.414] (assumes normal distribution) 27 | 28 | 29 | # JMH version: 1.29 30 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 31 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 32 | # VM options: 33 | # Blackhole mode: full + dont-inline hint 34 | # Warmup: 1 iterations, 10 s each 35 | # Measurement: 5 iterations, 4 s each 36 | # Timeout: 10 min per iteration 37 | # Threads: 1 thread, will synchronize iterations 38 | # Benchmark mode: Throughput, ops/time 39 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j2AsyncFile 40 | 41 | # Run progress: 16.67% complete, ETA 00:02:37 42 | # Fork: 1 of 1 43 | # Warmup Iteration 1: 1002.684 ops/ms 44 | Iteration 1: 1019.105 ops/ms 45 | Iteration 2: 1021.475 ops/ms 46 | Iteration 3: 995.193 ops/ms 47 | Iteration 4: 934.783 ops/ms 48 | Iteration 5: 1156.080 ops/ms 49 | 50 | 51 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j2AsyncFile": 52 | 1025.327 ±(99.9%) 311.975 ops/ms [Average] 53 | (min, avg, max) = (934.783, 1025.327, 1156.080), stdev = 81.019 54 | CI (99.9%): [713.353, 1337.302] (assumes normal distribution) 55 | 56 | 57 | # JMH version: 1.29 58 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 59 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 60 | # VM options: 61 | # Blackhole mode: full + dont-inline hint 62 | # Warmup: 1 iterations, 10 s each 63 | # Measurement: 5 iterations, 4 s each 64 | # Timeout: 10 min per iteration 65 | # Threads: 1 thread, will synchronize iterations 66 | # Benchmark mode: Throughput, ops/time 67 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.logbackFile 68 | 69 | # Run progress: 33.33% complete, ETA 00:02:06 70 | # Fork: 1 of 1 71 | # Warmup Iteration 1: 1501.226 ops/ms 72 | Iteration 1: 1518.268 ops/ms 73 | Iteration 2: 1172.671 ops/ms 74 | Iteration 3: 1701.152 ops/ms 75 | Iteration 4: 1615.095 ops/ms 76 | Iteration 5: 1628.762 ops/ms 77 | 78 | 79 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.logbackFile": 80 | 1527.190 ±(99.9%) 803.278 ops/ms [Average] 81 | (min, avg, max) = (1172.671, 1527.190, 1701.152), stdev = 208.609 82 | CI (99.9%): [723.911, 2330.468] (assumes normal distribution) 83 | 84 | 85 | # JMH version: 1.29 86 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 87 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 88 | # VM options: 89 | # Blackhole mode: full + dont-inline hint 90 | # Warmup: 1 iterations, 10 s each 91 | # Measurement: 5 iterations, 4 s each 92 | # Timeout: 10 min per iteration 93 | # Threads: 1 thread, will synchronize iterations 94 | # Benchmark mode: Throughput, ops/time 95 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.log4j1File 96 | 97 | # Run progress: 50.00% complete, ETA 00:01:34 98 | # Fork: 1 of 1 99 | # Warmup Iteration 1: 1175.080 ops/ms 100 | Iteration 1: 1194.931 ops/ms 101 | Iteration 2: 1191.605 ops/ms 102 | Iteration 3: 1204.642 ops/ms 103 | Iteration 4: 1046.422 ops/ms 104 | Iteration 5: 1239.146 ops/ms 105 | 106 | 107 | Result "ch.qos.logback.perf.FileAppenderBenchmark.log4j1File": 108 | 1175.349 ±(99.9%) 286.853 ops/ms [Average] 109 | (min, avg, max) = (1046.422, 1175.349, 1239.146), stdev = 74.495 110 | CI (99.9%): [888.496, 1462.203] (assumes normal distribution) 111 | 112 | 113 | # JMH version: 1.29 114 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 115 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 116 | # VM options: 117 | # Blackhole mode: full + dont-inline hint 118 | # Warmup: 1 iterations, 10 s each 119 | # Measurement: 5 iterations, 4 s each 120 | # Timeout: 10 min per iteration 121 | # Threads: 1 thread, will synchronize iterations 122 | # Benchmark mode: Throughput, ops/time 123 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.log4j2File 124 | 125 | # Run progress: 66.67% complete, ETA 00:01:02 126 | # Fork: 1 of 1 127 | # Warmup Iteration 1: 1417.459 ops/ms 128 | Iteration 1: 1472.648 ops/ms 129 | Iteration 2: 1451.324 ops/ms 130 | Iteration 3: 1517.871 ops/ms 131 | Iteration 4: 1486.583 ops/ms 132 | Iteration 5: 1319.087 ops/ms 133 | 134 | 135 | Result "ch.qos.logback.perf.FileAppenderBenchmark.log4j2File": 136 | 1449.503 ±(99.9%) 295.750 ops/ms [Average] 137 | (min, avg, max) = (1319.087, 1449.503, 1517.871), stdev = 76.805 138 | CI (99.9%): [1153.752, 1745.253] (assumes normal distribution) 139 | 140 | 141 | # JMH version: 1.29 142 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 143 | # VM invoker: /home/ceki/java/jdk-16.0.2/bin/java 144 | # VM options: 145 | # Blackhole mode: full + dont-inline hint 146 | # Warmup: 1 iterations, 10 s each 147 | # Measurement: 5 iterations, 4 s each 148 | # Timeout: 10 min per iteration 149 | # Threads: 1 thread, will synchronize iterations 150 | # Benchmark mode: Throughput, ops/time 151 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.logbackFile 152 | 153 | # Run progress: 83.33% complete, ETA 00:00:31 154 | # Fork: 1 of 1 155 | # Warmup Iteration 1: 1889.733 ops/ms 156 | Iteration 1: 1595.725 ops/ms 157 | Iteration 2: 1947.720 ops/ms 158 | Iteration 3: 1890.446 ops/ms 159 | Iteration 4: 1707.009 ops/ms 160 | Iteration 5: 1940.040 ops/ms 161 | 162 | 163 | Result "ch.qos.logback.perf.FileAppenderBenchmark.logbackFile": 164 | 1816.188 ±(99.9%) 604.803 ops/ms [Average] 165 | (min, avg, max) = (1595.725, 1816.188, 1947.720), stdev = 157.065 166 | CI (99.9%): [1211.385, 2420.991] (assumes normal distribution) 167 | 168 | 169 | # Run complete. Total time: 00:03:08 170 | 171 | REMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on 172 | why the numbers are the way they are. Use profilers (see -prof, -lprof), design factorial 173 | experiments, perform baseline and negative tests that provide experimental control, make sure 174 | the benchmarking environment is safe on JVM/OS/HW level, ask for reviews from the domain experts. 175 | Do not assume the numbers tell you what you want them to tell. 176 | 177 | Benchmark Mode Cnt Score Error Units 178 | AsyncWithFileAppenderBenchmark.log4j1File thrpt 5 697.908 ± 121.507 ops/ms 179 | AsyncWithFileAppenderBenchmark.log4j2AsyncFile thrpt 5 1025.327 ± 311.975 ops/ms 180 | AsyncWithFileAppenderBenchmark.logbackFile thrpt 5 1527.190 ± 803.278 ops/ms 181 | FileAppenderBenchmark.log4j1File thrpt 5 1175.349 ± 286.853 ops/ms 182 | FileAppenderBenchmark.log4j2File thrpt 5 1449.503 ± 295.750 ops/ms 183 | FileAppenderBenchmark.logbackFile thrpt 5 1816.188 ± 604.803 ops/ms 184 | -------------------------------------------------------------------------------- /results/i7-8565U-windows-4seconds/results-2021-11-13T1228-16.txt: -------------------------------------------------------------------------------- 1 | # JMH version: 1.29 2 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 3 | # VM invoker: C:\java\jdk-16.0.2\bin\java.exe 4 | # VM options: 5 | # Blackhole mode: full + dont-inline hint 6 | # Warmup: 2 iterations, 10 s each 7 | # Measurement: 4 iterations, 4 s each 8 | # Timeout: 3 s per iteration, ***WARNING: The timeout might be too low!*** 9 | # Threads: 16 threads, will synchronize iterations 10 | # Benchmark mode: Throughput, ops/time 11 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j1File 12 | 13 | # Run progress: 0.00% complete, ETA 00:03:36 14 | # Fork: 1 of 1 15 | # Warmup Iteration 1: 872.719 ops/ms 16 | # Warmup Iteration 2: 929.134 ops/ms 17 | Iteration 1: 917.675 ops/ms 18 | Iteration 2: 901.209 ops/ms 19 | Iteration 3: 936.990 ops/ms 20 | Iteration 4: 939.945 ops/ms 21 | 22 | 23 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j1File": 24 | 923.955 ±(99.9%) 116.936 ops/ms [Average] 25 | (min, avg, max) = (901.209, 923.955, 939.945), stdev = 18.096 26 | CI (99.9%): [807.019, 1040.891] (assumes normal distribution) 27 | 28 | 29 | # JMH version: 1.29 30 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 31 | # VM invoker: C:\java\jdk-16.0.2\bin\java.exe 32 | # VM options: 33 | # Blackhole mode: full + dont-inline hint 34 | # Warmup: 2 iterations, 10 s each 35 | # Measurement: 4 iterations, 4 s each 36 | # Timeout: 3 s per iteration, ***WARNING: The timeout might be too low!*** 37 | # Threads: 16 threads, will synchronize iterations 38 | # Benchmark mode: Throughput, ops/time 39 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j2AsyncFile 40 | 41 | # Run progress: 16.67% complete, ETA 00:03:05 42 | # Fork: 1 of 1 43 | # Warmup Iteration 1: 349.351 ops/ms 44 | # Warmup Iteration 2: 364.543 ops/ms 45 | Iteration 1: 364.251 ops/ms 46 | Iteration 2: 361.576 ops/ms 47 | Iteration 3: 362.125 ops/ms 48 | Iteration 4: 360.276 ops/ms 49 | 50 | 51 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j2AsyncFile": 52 | 362.057 ±(99.9%) 10.698 ops/ms [Average] 53 | (min, avg, max) = (360.276, 362.057, 364.251), stdev = 1.656 54 | CI (99.9%): [351.359, 372.755] (assumes normal distribution) 55 | 56 | 57 | # JMH version: 1.29 58 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 59 | # VM invoker: C:\java\jdk-16.0.2\bin\java.exe 60 | # VM options: 61 | # Blackhole mode: full + dont-inline hint 62 | # Warmup: 2 iterations, 10 s each 63 | # Measurement: 4 iterations, 4 s each 64 | # Timeout: 3 s per iteration, ***WARNING: The timeout might be too low!*** 65 | # Threads: 16 threads, will synchronize iterations 66 | # Benchmark mode: Throughput, ops/time 67 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.logbackFile 68 | 69 | # Run progress: 33.33% complete, ETA 00:02:29 70 | # Fork: 1 of 1 71 | # Warmup Iteration 1: 1804.432 ops/ms 72 | # Warmup Iteration 2: 1657.396 ops/ms 73 | Iteration 1: 1663.893 ops/ms 74 | Iteration 2: 1688.891 ops/ms 75 | Iteration 3: 1666.301 ops/ms 76 | Iteration 4: 1194.614 ops/ms 77 | 78 | 79 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.logbackFile": 80 | 1553.425 ±(99.9%) 1547.464 ops/ms [Average] 81 | (min, avg, max) = (1194.614, 1553.425, 1688.891), stdev = 239.472 82 | CI (99.9%): [5.961, 3100.888] (assumes normal distribution) 83 | 84 | 85 | # JMH version: 1.29 86 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 87 | # VM invoker: C:\java\jdk-16.0.2\bin\java.exe 88 | # VM options: 89 | # Blackhole mode: full + dont-inline hint 90 | # Warmup: 2 iterations, 10 s each 91 | # Measurement: 4 iterations, 4 s each 92 | # Timeout: 3 s per iteration, ***WARNING: The timeout might be too low!*** 93 | # Threads: 16 threads, will synchronize iterations 94 | # Benchmark mode: Throughput, ops/time 95 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.log4j1File 96 | 97 | # Run progress: 50.00% complete, ETA 00:01:52 98 | # Fork: 1 of 1 99 | # Warmup Iteration 1: 795.195 ops/ms 100 | # Warmup Iteration 2: 827.788 ops/ms 101 | Iteration 1: 831.860 ops/ms 102 | Iteration 2: 830.997 ops/ms 103 | Iteration 3: 829.661 ops/ms 104 | Iteration 4: 827.061 ops/ms 105 | 106 | 107 | Result "ch.qos.logback.perf.FileAppenderBenchmark.log4j1File": 108 | 829.895 ±(99.9%) 13.535 ops/ms [Average] 109 | (min, avg, max) = (827.061, 829.895, 831.860), stdev = 2.095 110 | CI (99.9%): [816.360, 843.430] (assumes normal distribution) 111 | 112 | 113 | # JMH version: 1.29 114 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 115 | # VM invoker: C:\java\jdk-16.0.2\bin\java.exe 116 | # VM options: 117 | # Blackhole mode: full + dont-inline hint 118 | # Warmup: 2 iterations, 10 s each 119 | # Measurement: 4 iterations, 4 s each 120 | # Timeout: 3 s per iteration, ***WARNING: The timeout might be too low!*** 121 | # Threads: 16 threads, will synchronize iterations 122 | # Benchmark mode: Throughput, ops/time 123 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.log4j2File 124 | 125 | # Run progress: 66.67% complete, ETA 00:01:15 126 | # Fork: 1 of 1 127 | # Warmup Iteration 1: 942.373 ops/ms 128 | # Warmup Iteration 2: 999.720 ops/ms 129 | Iteration 1: 994.893 ops/ms 130 | Iteration 2: 962.043 ops/ms 131 | Iteration 3: 1002.279 ops/ms 132 | Iteration 4: 1005.313 ops/ms 133 | 134 | 135 | Result "ch.qos.logback.perf.FileAppenderBenchmark.log4j2File": 136 | 991.132 ±(99.9%) 128.466 ops/ms [Average] 137 | (min, avg, max) = (962.043, 991.132, 1005.313), stdev = 19.880 138 | CI (99.9%): [862.666, 1119.598] (assumes normal distribution) 139 | 140 | 141 | # JMH version: 1.29 142 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 143 | # VM invoker: C:\java\jdk-16.0.2\bin\java.exe 144 | # VM options: 145 | # Blackhole mode: full + dont-inline hint 146 | # Warmup: 2 iterations, 10 s each 147 | # Measurement: 4 iterations, 4 s each 148 | # Timeout: 3 s per iteration, ***WARNING: The timeout might be too low!*** 149 | # Threads: 16 threads, will synchronize iterations 150 | # Benchmark mode: Throughput, ops/time 151 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.logbackFile 152 | 153 | # Run progress: 83.33% complete, ETA 00:00:37 154 | # Fork: 1 of 1 155 | # Warmup Iteration 1: 1418.453 ops/ms 156 | # Warmup Iteration 2: 1467.693 ops/ms 157 | Iteration 1: 1454.965 ops/ms 158 | Iteration 2: 1466.173 ops/ms 159 | Iteration 3: 1461.485 ops/ms 160 | Iteration 4: 1459.637 ops/ms 161 | 162 | 163 | Result "ch.qos.logback.perf.FileAppenderBenchmark.logbackFile": 164 | 1460.565 ±(99.9%) 29.968 ops/ms [Average] 165 | (min, avg, max) = (1454.965, 1460.565, 1466.173), stdev = 4.638 166 | CI (99.9%): [1430.598, 1490.533] (assumes normal distribution) 167 | 168 | 169 | # Run complete. Total time: 00:03:47 170 | 171 | REMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on 172 | why the numbers are the way they are. Use profilers (see -prof, -lprof), design factorial 173 | experiments, perform baseline and negative tests that provide experimental control, make sure 174 | the benchmarking environment is safe on JVM/OS/HW level, ask for reviews from the domain experts. 175 | Do not assume the numbers tell you what you want them to tell. 176 | 177 | Benchmark Mode Cnt Score Error Units 178 | AsyncWithFileAppenderBenchmark.log4j1File thrpt 4 923.955 ± 116.936 ops/ms 179 | AsyncWithFileAppenderBenchmark.log4j2AsyncFile thrpt 4 362.057 ± 10.698 ops/ms 180 | AsyncWithFileAppenderBenchmark.logbackFile thrpt 4 1553.425 ± 1547.464 ops/ms 181 | FileAppenderBenchmark.log4j1File thrpt 4 829.895 ± 13.535 ops/ms 182 | FileAppenderBenchmark.log4j2File thrpt 4 991.132 ± 128.466 ops/ms 183 | FileAppenderBenchmark.logbackFile thrpt 4 1460.565 ± 29.968 ops/ms 184 | -------------------------------------------------------------------------------- /results/i7-8565U-windows-4seconds/results-2021-11-13T1228-4.txt: -------------------------------------------------------------------------------- 1 | # JMH version: 1.29 2 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 3 | # VM invoker: C:\java\jdk-16.0.2\bin\java.exe 4 | # VM options: 5 | # Blackhole mode: full + dont-inline hint 6 | # Warmup: 2 iterations, 10 s each 7 | # Measurement: 4 iterations, 4 s each 8 | # Timeout: 3 s per iteration, ***WARNING: The timeout might be too low!*** 9 | # Threads: 4 threads, will synchronize iterations 10 | # Benchmark mode: Throughput, ops/time 11 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j1File 12 | 13 | # Run progress: 0.00% complete, ETA 00:03:36 14 | # Fork: 1 of 1 15 | # Warmup Iteration 1: 854.350 ops/ms 16 | # Warmup Iteration 2: 892.506 ops/ms 17 | Iteration 1: 934.703 ops/ms 18 | Iteration 2: 922.526 ops/ms 19 | Iteration 3: 933.133 ops/ms 20 | Iteration 4: 931.961 ops/ms 21 | 22 | 23 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j1File": 24 | 930.581 ±(99.9%) 35.453 ops/ms [Average] 25 | (min, avg, max) = (922.526, 930.581, 934.703), stdev = 5.486 26 | CI (99.9%): [895.127, 966.034] (assumes normal distribution) 27 | 28 | 29 | # JMH version: 1.29 30 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 31 | # VM invoker: C:\java\jdk-16.0.2\bin\java.exe 32 | # VM options: 33 | # Blackhole mode: full + dont-inline hint 34 | # Warmup: 2 iterations, 10 s each 35 | # Measurement: 4 iterations, 4 s each 36 | # Timeout: 3 s per iteration, ***WARNING: The timeout might be too low!*** 37 | # Threads: 4 threads, will synchronize iterations 38 | # Benchmark mode: Throughput, ops/time 39 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j2AsyncFile 40 | 41 | # Run progress: 16.67% complete, ETA 00:03:05 42 | # Fork: 1 of 1 43 | # Warmup Iteration 1: 312.988 ops/ms 44 | # Warmup Iteration 2: 329.682 ops/ms 45 | Iteration 1: 329.742 ops/ms 46 | Iteration 2: 331.476 ops/ms 47 | Iteration 3: 329.810 ops/ms 48 | Iteration 4: 328.703 ops/ms 49 | 50 | 51 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j2AsyncFile": 52 | 329.933 ±(99.9%) 7.409 ops/ms [Average] 53 | (min, avg, max) = (328.703, 329.933, 331.476), stdev = 1.147 54 | CI (99.9%): [322.524, 337.342] (assumes normal distribution) 55 | 56 | 57 | # JMH version: 1.29 58 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 59 | # VM invoker: C:\java\jdk-16.0.2\bin\java.exe 60 | # VM options: 61 | # Blackhole mode: full + dont-inline hint 62 | # Warmup: 2 iterations, 10 s each 63 | # Measurement: 4 iterations, 4 s each 64 | # Timeout: 3 s per iteration, ***WARNING: The timeout might be too low!*** 65 | # Threads: 4 threads, will synchronize iterations 66 | # Benchmark mode: Throughput, ops/time 67 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.logbackFile 68 | 69 | # Run progress: 33.33% complete, ETA 00:02:29 70 | # Fork: 1 of 1 71 | # Warmup Iteration 1: 1820.573 ops/ms 72 | # Warmup Iteration 2: 1698.355 ops/ms 73 | Iteration 1: 1499.700 ops/ms 74 | Iteration 2: 1867.716 ops/ms 75 | Iteration 3: 1507.162 ops/ms 76 | Iteration 4: 1885.679 ops/ms 77 | 78 | 79 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.logbackFile": 80 | 1690.064 ±(99.9%) 1393.540 ops/ms [Average] 81 | (min, avg, max) = (1499.700, 1690.064, 1885.679), stdev = 215.652 82 | CI (99.9%): [296.524, 3083.604] (assumes normal distribution) 83 | 84 | 85 | # JMH version: 1.29 86 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 87 | # VM invoker: C:\java\jdk-16.0.2\bin\java.exe 88 | # VM options: 89 | # Blackhole mode: full + dont-inline hint 90 | # Warmup: 2 iterations, 10 s each 91 | # Measurement: 4 iterations, 4 s each 92 | # Timeout: 3 s per iteration, ***WARNING: The timeout might be too low!*** 93 | # Threads: 4 threads, will synchronize iterations 94 | # Benchmark mode: Throughput, ops/time 95 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.log4j1File 96 | 97 | # Run progress: 50.00% complete, ETA 00:01:52 98 | # Fork: 1 of 1 99 | # Warmup Iteration 1: 626.600 ops/ms 100 | # Warmup Iteration 2: 654.216 ops/ms 101 | Iteration 1: 659.437 ops/ms 102 | Iteration 2: 657.951 ops/ms 103 | Iteration 3: 657.781 ops/ms 104 | Iteration 4: 649.750 ops/ms 105 | 106 | 107 | Result "ch.qos.logback.perf.FileAppenderBenchmark.log4j1File": 108 | 656.230 ±(99.9%) 28.327 ops/ms [Average] 109 | (min, avg, max) = (649.750, 656.230, 659.437), stdev = 4.384 110 | CI (99.9%): [627.903, 684.557] (assumes normal distribution) 111 | 112 | 113 | # JMH version: 1.29 114 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 115 | # VM invoker: C:\java\jdk-16.0.2\bin\java.exe 116 | # VM options: 117 | # Blackhole mode: full + dont-inline hint 118 | # Warmup: 2 iterations, 10 s each 119 | # Measurement: 4 iterations, 4 s each 120 | # Timeout: 3 s per iteration, ***WARNING: The timeout might be too low!*** 121 | # Threads: 4 threads, will synchronize iterations 122 | # Benchmark mode: Throughput, ops/time 123 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.log4j2File 124 | 125 | # Run progress: 66.67% complete, ETA 00:01:15 126 | # Fork: 1 of 1 127 | # Warmup Iteration 1: 1018.999 ops/ms 128 | # Warmup Iteration 2: 1101.944 ops/ms 129 | Iteration 1: 1109.986 ops/ms 130 | Iteration 2: 1037.650 ops/ms 131 | Iteration 3: 1062.006 ops/ms 132 | Iteration 4: 1070.699 ops/ms 133 | 134 | 135 | Result "ch.qos.logback.perf.FileAppenderBenchmark.log4j2File": 136 | 1070.085 ±(99.9%) 194.211 ops/ms [Average] 137 | (min, avg, max) = (1037.650, 1070.085, 1109.986), stdev = 30.054 138 | CI (99.9%): [875.874, 1264.296] (assumes normal distribution) 139 | 140 | 141 | # JMH version: 1.29 142 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 143 | # VM invoker: C:\java\jdk-16.0.2\bin\java.exe 144 | # VM options: 145 | # Blackhole mode: full + dont-inline hint 146 | # Warmup: 2 iterations, 10 s each 147 | # Measurement: 4 iterations, 4 s each 148 | # Timeout: 3 s per iteration, ***WARNING: The timeout might be too low!*** 149 | # Threads: 4 threads, will synchronize iterations 150 | # Benchmark mode: Throughput, ops/time 151 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.logbackFile 152 | 153 | # Run progress: 83.33% complete, ETA 00:00:37 154 | # Fork: 1 of 1 155 | # Warmup Iteration 1: 1441.241 ops/ms 156 | # Warmup Iteration 2: 1236.068 ops/ms 157 | Iteration 1: 1495.628 ops/ms 158 | Iteration 2: 1479.628 ops/ms 159 | Iteration 3: 1465.916 ops/ms 160 | Iteration 4: 1514.090 ops/ms 161 | 162 | 163 | Result "ch.qos.logback.perf.FileAppenderBenchmark.logbackFile": 164 | 1488.815 ±(99.9%) 134.208 ops/ms [Average] 165 | (min, avg, max) = (1465.916, 1488.815, 1514.090), stdev = 20.769 166 | CI (99.9%): [1354.608, 1623.023] (assumes normal distribution) 167 | 168 | 169 | # Run complete. Total time: 00:03:45 170 | 171 | REMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on 172 | why the numbers are the way they are. Use profilers (see -prof, -lprof), design factorial 173 | experiments, perform baseline and negative tests that provide experimental control, make sure 174 | the benchmarking environment is safe on JVM/OS/HW level, ask for reviews from the domain experts. 175 | Do not assume the numbers tell you what you want them to tell. 176 | 177 | Benchmark Mode Cnt Score Error Units 178 | AsyncWithFileAppenderBenchmark.log4j1File thrpt 4 930.581 ± 35.453 ops/ms 179 | AsyncWithFileAppenderBenchmark.log4j2AsyncFile thrpt 4 329.933 ± 7.409 ops/ms 180 | AsyncWithFileAppenderBenchmark.logbackFile thrpt 4 1690.064 ± 1393.540 ops/ms 181 | FileAppenderBenchmark.log4j1File thrpt 4 656.230 ± 28.327 ops/ms 182 | FileAppenderBenchmark.log4j2File thrpt 4 1070.085 ± 194.211 ops/ms 183 | FileAppenderBenchmark.logbackFile thrpt 4 1488.815 ± 134.208 ops/ms 184 | -------------------------------------------------------------------------------- /results/i7-8565U-windows-60seconds/results-2021-11-13T1035-1.txt: -------------------------------------------------------------------------------- 1 | # JMH version: 1.29 2 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 3 | # VM invoker: C:\java\jdk-16.0.2\bin\java.exe 4 | # VM options: 5 | # Blackhole mode: full + dont-inline hint 6 | # Warmup: 2 iterations, 10 s each 7 | # Measurement: 4 iterations, 60 s each 8 | # Timeout: 3 s per iteration, ***WARNING: The timeout might be too low!*** 9 | # Threads: 1 thread, will synchronize iterations 10 | # Benchmark mode: Throughput, ops/time 11 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j1File 12 | 13 | # Run progress: 0.00% complete, ETA 00:26:00 14 | # Fork: 1 of 1 15 | # Warmup Iteration 1: 1173.543 ops/ms 16 | # Warmup Iteration 2: 1146.693 ops/ms 17 | Iteration 1: 1162.889 ops/ms 18 | Iteration 2: 290.897 ops/ms 19 | Iteration 3: 187.019 ops/ms 20 | Iteration 4: 186.476 ops/ms 21 | 22 | 23 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j1File": 24 | 456.820 ±(99.9%) 3058.241 ops/ms [Average] 25 | (min, avg, max) = (186.476, 456.820, 1162.889), stdev = 473.266 26 | CI (99.9%): [≈ 0, 3515.061] (assumes normal distribution) 27 | 28 | 29 | # JMH version: 1.29 30 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 31 | # VM invoker: C:\java\jdk-16.0.2\bin\java.exe 32 | # VM options: 33 | # Blackhole mode: full + dont-inline hint 34 | # Warmup: 2 iterations, 10 s each 35 | # Measurement: 4 iterations, 60 s each 36 | # Timeout: 3 s per iteration, ***WARNING: The timeout might be too low!*** 37 | # Threads: 1 thread, will synchronize iterations 38 | # Benchmark mode: Throughput, ops/time 39 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j2AsyncFile 40 | 41 | # Run progress: 16.67% complete, ETA 00:21:46 42 | # Fork: 1 of 1 43 | # Warmup Iteration 1: 317.693 ops/ms 44 | # Warmup Iteration 2: 318.271 ops/ms 45 | Iteration 1: 325.104 ops/ms 46 | Iteration 2: 323.242 ops/ms 47 | Iteration 3: 319.670 ops/ms 48 | Iteration 4: 328.815 ops/ms 49 | 50 | 51 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j2AsyncFile": 52 | 324.208 ±(99.9%) 24.623 ops/ms [Average] 53 | (min, avg, max) = (319.670, 324.208, 328.815), stdev = 3.810 54 | CI (99.9%): [299.585, 348.831] (assumes normal distribution) 55 | 56 | 57 | # JMH version: 1.29 58 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 59 | # VM invoker: C:\java\jdk-16.0.2\bin\java.exe 60 | # VM options: 61 | # Blackhole mode: full + dont-inline hint 62 | # Warmup: 2 iterations, 10 s each 63 | # Measurement: 4 iterations, 60 s each 64 | # Timeout: 3 s per iteration, ***WARNING: The timeout might be too low!*** 65 | # Threads: 1 thread, will synchronize iterations 66 | # Benchmark mode: Throughput, ops/time 67 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.logbackFile 68 | 69 | # Run progress: 33.33% complete, ETA 00:17:30 70 | # Fork: 1 of 1 71 | # Warmup Iteration 1: 1739.701 ops/ms 72 | # Warmup Iteration 2: 1050.645 ops/ms 73 | Iteration 1: 1291.097 ops/ms 74 | Iteration 2: 454.736 ops/ms 75 | Iteration 3: 184.157 ops/ms 76 | Iteration 4: 163.182 ops/ms 77 | 78 | 79 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.logbackFile": 80 | 523.293 ±(99.9%) 3417.157 ops/ms [Average] 81 | (min, avg, max) = (163.182, 523.293, 1291.097), stdev = 528.809 82 | CI (99.9%): [≈ 0, 3940.450] (assumes normal distribution) 83 | 84 | 85 | # JMH version: 1.29 86 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 87 | # VM invoker: C:\java\jdk-16.0.2\bin\java.exe 88 | # VM options: 89 | # Blackhole mode: full + dont-inline hint 90 | # Warmup: 2 iterations, 10 s each 91 | # Measurement: 4 iterations, 60 s each 92 | # Timeout: 3 s per iteration, ***WARNING: The timeout might be too low!*** 93 | # Threads: 1 thread, will synchronize iterations 94 | # Benchmark mode: Throughput, ops/time 95 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.log4j1File 96 | 97 | # Run progress: 50.00% complete, ETA 00:13:07 98 | # Fork: 1 of 1 99 | # Warmup Iteration 1: 288.413 ops/ms 100 | # Warmup Iteration 2: 302.022 ops/ms 101 | Iteration 1: 213.870 ops/ms 102 | Iteration 2: 207.311 ops/ms 103 | Iteration 3: 286.700 ops/ms 104 | Iteration 4: (*interrupt*) (*interrupt*) 231.935 ops/ms 105 | 106 | 107 | Result "ch.qos.logback.perf.FileAppenderBenchmark.log4j1File": 108 | 234.954 ±(99.9%) 232.852 ops/ms [Average] 109 | (min, avg, max) = (207.311, 234.954, 286.700), stdev = 36.034 110 | CI (99.9%): [2.102, 467.806] (assumes normal distribution) 111 | 112 | 113 | # JMH version: 1.29 114 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 115 | # VM invoker: C:\java\jdk-16.0.2\bin\java.exe 116 | # VM options: 117 | # Blackhole mode: full + dont-inline hint 118 | # Warmup: 2 iterations, 10 s each 119 | # Measurement: 4 iterations, 60 s each 120 | # Timeout: 3 s per iteration, ***WARNING: The timeout might be too low!*** 121 | # Threads: 1 thread, will synchronize iterations 122 | # Benchmark mode: Throughput, ops/time 123 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.log4j2File 124 | 125 | # Run progress: 66.67% complete, ETA 00:08:47 126 | # Fork: 1 of 1 127 | # Warmup Iteration 1: 1096.008 ops/ms 128 | # Warmup Iteration 2: 924.558 ops/ms 129 | Iteration 1: 431.020 ops/ms 130 | Iteration 2: 359.289 ops/ms 131 | Iteration 3: 227.540 ops/ms 132 | Iteration 4: (*interrupt*) (*interrupt*) 233.516 ops/ms 133 | 134 | 135 | Result "ch.qos.logback.perf.FileAppenderBenchmark.log4j2File": 136 | 312.841 ±(99.9%) 642.879 ops/ms [Average] 137 | (min, avg, max) = (227.540, 312.841, 431.020), stdev = 99.486 138 | CI (99.9%): [≈ 0, 955.720] (assumes normal distribution) 139 | 140 | 141 | # JMH version: 1.29 142 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 143 | # VM invoker: C:\java\jdk-16.0.2\bin\java.exe 144 | # VM options: 145 | # Blackhole mode: full + dont-inline hint 146 | # Warmup: 2 iterations, 10 s each 147 | # Measurement: 4 iterations, 60 s each 148 | # Timeout: 3 s per iteration, ***WARNING: The timeout might be too low!*** 149 | # Threads: 1 thread, will synchronize iterations 150 | # Benchmark mode: Throughput, ops/time 151 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.logbackFile 152 | 153 | # Run progress: 83.33% complete, ETA 00:04:24 154 | # Fork: 1 of 1 155 | # Warmup Iteration 1: 990.537 ops/ms 156 | # Warmup Iteration 2: 876.329 ops/ms 157 | Iteration 1: 902.930 ops/ms 158 | Iteration 2: 365.496 ops/ms 159 | Iteration 3: 234.522 ops/ms 160 | Iteration 4: (*interrupt*) (*interrupt*) 233.913 ops/ms 161 | 162 | 163 | Result "ch.qos.logback.perf.FileAppenderBenchmark.logbackFile": 164 | 434.216 ±(99.9%) 2058.440 ops/ms [Average] 165 | (min, avg, max) = (233.913, 434.216, 902.930), stdev = 318.546 166 | CI (99.9%): [≈ 0, 2492.655] (assumes normal distribution) 167 | 168 | 169 | # Run complete. Total time: 00:26:28 170 | 171 | REMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on 172 | why the numbers are the way they are. Use profilers (see -prof, -lprof), design factorial 173 | experiments, perform baseline and negative tests that provide experimental control, make sure 174 | the benchmarking environment is safe on JVM/OS/HW level, ask for reviews from the domain experts. 175 | Do not assume the numbers tell you what you want them to tell. 176 | 177 | Benchmark Mode Cnt Score Error Units 178 | AsyncWithFileAppenderBenchmark.log4j1File thrpt 4 456.820 ± 3058.241 ops/ms 179 | AsyncWithFileAppenderBenchmark.log4j2AsyncFile thrpt 4 324.208 ± 24.623 ops/ms 180 | AsyncWithFileAppenderBenchmark.logbackFile thrpt 4 523.293 ± 3417.157 ops/ms 181 | FileAppenderBenchmark.log4j1File thrpt 4 234.954 ± 232.852 ops/ms 182 | FileAppenderBenchmark.log4j2File thrpt 4 312.841 ± 642.879 ops/ms 183 | FileAppenderBenchmark.logbackFile thrpt 4 434.216 ± 2058.440 ops/ms 184 | -------------------------------------------------------------------------------- /results/i7-8565U-windows-4seconds/results-2021-11-13T1228-1.txt: -------------------------------------------------------------------------------- 1 | # JMH version: 1.29 2 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 3 | # VM invoker: C:\java\jdk-16.0.2\bin\java.exe 4 | # VM options: 5 | # Blackhole mode: full + dont-inline hint 6 | # Warmup: 2 iterations, 10 s each 7 | # Measurement: 4 iterations, 4 s each 8 | # Timeout: 3 s per iteration, ***WARNING: The timeout might be too low!*** 9 | # Threads: 1 thread, will synchronize iterations 10 | # Benchmark mode: Throughput, ops/time 11 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j1File 12 | 13 | # Run progress: 0.00% complete, ETA 00:03:36 14 | # Fork: 1 of 1 15 | # Warmup Iteration 1: 825.806 ops/ms 16 | # Warmup Iteration 2: 847.023 ops/ms 17 | Iteration 1: 873.935 ops/ms 18 | Iteration 2: 858.186 ops/ms 19 | Iteration 3: 873.491 ops/ms 20 | Iteration 4: 816.414 ops/ms 21 | 22 | 23 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j1File": 24 | 855.507 ±(99.9%) 174.930 ops/ms [Average] 25 | (min, avg, max) = (816.414, 855.507, 873.935), stdev = 27.071 26 | CI (99.9%): [680.577, 1030.436] (assumes normal distribution) 27 | 28 | 29 | # JMH version: 1.29 30 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 31 | # VM invoker: C:\java\jdk-16.0.2\bin\java.exe 32 | # VM options: 33 | # Blackhole mode: full + dont-inline hint 34 | # Warmup: 2 iterations, 10 s each 35 | # Measurement: 4 iterations, 4 s each 36 | # Timeout: 3 s per iteration, ***WARNING: The timeout might be too low!*** 37 | # Threads: 1 thread, will synchronize iterations 38 | # Benchmark mode: Throughput, ops/time 39 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j2AsyncFile 40 | 41 | # Run progress: 16.67% complete, ETA 00:03:05 42 | # Fork: 1 of 1 43 | # Warmup Iteration 1: 320.365 ops/ms 44 | # Warmup Iteration 2: 320.429 ops/ms 45 | Iteration 1: 321.427 ops/ms 46 | Iteration 2: 282.404 ops/ms 47 | Iteration 3: 321.036 ops/ms 48 | Iteration 4: 319.444 ops/ms 49 | 50 | 51 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.log4j2AsyncFile": 52 | 311.078 ±(99.9%) 123.651 ops/ms [Average] 53 | (min, avg, max) = (282.404, 311.078, 321.427), stdev = 19.135 54 | CI (99.9%): [187.426, 434.729] (assumes normal distribution) 55 | 56 | 57 | # JMH version: 1.29 58 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 59 | # VM invoker: C:\java\jdk-16.0.2\bin\java.exe 60 | # VM options: 61 | # Blackhole mode: full + dont-inline hint 62 | # Warmup: 2 iterations, 10 s each 63 | # Measurement: 4 iterations, 4 s each 64 | # Timeout: 3 s per iteration, ***WARNING: The timeout might be too low!*** 65 | # Threads: 1 thread, will synchronize iterations 66 | # Benchmark mode: Throughput, ops/time 67 | # Benchmark: ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.logbackFile 68 | 69 | # Run progress: 33.33% complete, ETA 00:02:30 70 | # Fork: 1 of 1 71 | # Warmup Iteration 1: 2357.816 ops/ms 72 | # Warmup Iteration 2: 1904.760 ops/ms 73 | Iteration 1: 1572.358 ops/ms 74 | Iteration 2: 1925.416 ops/ms 75 | Iteration 3: 766.158 ops/ms 76 | Iteration 4: 2379.135 ops/ms 77 | 78 | 79 | Result "ch.qos.logback.perf.AsyncWithFileAppenderBenchmark.logbackFile": 80 | 1660.767 ±(99.9%) 4405.278 ops/ms [Average] 81 | (min, avg, max) = (766.158, 1660.767, 2379.135), stdev = 681.722 82 | CI (99.9%): [≈ 0, 6066.045] (assumes normal distribution) 83 | 84 | 85 | # JMH version: 1.29 86 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 87 | # VM invoker: C:\java\jdk-16.0.2\bin\java.exe 88 | # VM options: 89 | # Blackhole mode: full + dont-inline hint 90 | # Warmup: 2 iterations, 10 s each 91 | # Measurement: 4 iterations, 4 s each 92 | # Timeout: 3 s per iteration, ***WARNING: The timeout might be too low!*** 93 | # Threads: 1 thread, will synchronize iterations 94 | # Benchmark mode: Throughput, ops/time 95 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.log4j1File 96 | 97 | # Run progress: 50.00% complete, ETA 00:01:53 98 | # Fork: 1 of 1 99 | # Warmup Iteration 1: 1158.015 ops/ms 100 | # Warmup Iteration 2: 1173.418 ops/ms 101 | Iteration 1: 1172.780 ops/ms 102 | Iteration 2: 1142.377 ops/ms 103 | Iteration 3: 1188.014 ops/ms 104 | Iteration 4: (*interrupt*) (*interrupt*) 1163.424 ops/ms 105 | 106 | 107 | Result "ch.qos.logback.perf.FileAppenderBenchmark.log4j1File": 108 | 1166.649 ±(99.9%) 123.377 ops/ms [Average] 109 | (min, avg, max) = (1142.377, 1166.649, 1188.014), stdev = 19.093 110 | CI (99.9%): [1043.272, 1290.025] (assumes normal distribution) 111 | 112 | 113 | # JMH version: 1.29 114 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 115 | # VM invoker: C:\java\jdk-16.0.2\bin\java.exe 116 | # VM options: 117 | # Blackhole mode: full + dont-inline hint 118 | # Warmup: 2 iterations, 10 s each 119 | # Measurement: 4 iterations, 4 s each 120 | # Timeout: 3 s per iteration, ***WARNING: The timeout might be too low!*** 121 | # Threads: 1 thread, will synchronize iterations 122 | # Benchmark mode: Throughput, ops/time 123 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.log4j2File 124 | 125 | # Run progress: 66.67% complete, ETA 00:01:16 126 | # Fork: 1 of 1 127 | # Warmup Iteration 1: 1162.098 ops/ms 128 | # Warmup Iteration 2: 1209.674 ops/ms 129 | Iteration 1: 1214.760 ops/ms 130 | Iteration 2: 1222.605 ops/ms 131 | Iteration 3: 1209.360 ops/ms 132 | Iteration 4: 1211.796 ops/ms 133 | 134 | 135 | Result "ch.qos.logback.perf.FileAppenderBenchmark.log4j2File": 136 | 1214.630 ±(99.9%) 37.202 ops/ms [Average] 137 | (min, avg, max) = (1209.360, 1214.630, 1222.605), stdev = 5.757 138 | CI (99.9%): [1177.428, 1251.832] (assumes normal distribution) 139 | 140 | 141 | # JMH version: 1.29 142 | # VM version: JDK 16.0.2, Java HotSpot(TM) 64-Bit Server VM, 16.0.2+7-67 143 | # VM invoker: C:\java\jdk-16.0.2\bin\java.exe 144 | # VM options: 145 | # Blackhole mode: full + dont-inline hint 146 | # Warmup: 2 iterations, 10 s each 147 | # Measurement: 4 iterations, 4 s each 148 | # Timeout: 3 s per iteration, ***WARNING: The timeout might be too low!*** 149 | # Threads: 1 thread, will synchronize iterations 150 | # Benchmark mode: Throughput, ops/time 151 | # Benchmark: ch.qos.logback.perf.FileAppenderBenchmark.logbackFile 152 | 153 | # Run progress: 83.33% complete, ETA 00:00:38 154 | # Fork: 1 of 1 155 | # Warmup Iteration 1: 2159.464 ops/ms 156 | # Warmup Iteration 2: 1840.927 ops/ms 157 | Iteration 1: 2081.308 ops/ms 158 | Iteration 2: 1478.038 ops/ms 159 | Iteration 3: 1750.242 ops/ms 160 | Iteration 4: (*interrupt*) 1741.049 ops/ms 161 | 162 | 163 | Result "ch.qos.logback.perf.FileAppenderBenchmark.logbackFile": 164 | 1762.659 ±(99.9%) 1596.723 ops/ms [Average] 165 | (min, avg, max) = (1478.038, 1762.659, 2081.308), stdev = 247.095 166 | CI (99.9%): [165.937, 3359.382] (assumes normal distribution) 167 | 168 | 169 | # Run complete. Total time: 00:03:48 170 | 171 | REMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on 172 | why the numbers are the way they are. Use profilers (see -prof, -lprof), design factorial 173 | experiments, perform baseline and negative tests that provide experimental control, make sure 174 | the benchmarking environment is safe on JVM/OS/HW level, ask for reviews from the domain experts. 175 | Do not assume the numbers tell you what you want them to tell. 176 | 177 | Benchmark Mode Cnt Score Error Units 178 | AsyncWithFileAppenderBenchmark.log4j1File thrpt 4 855.507 ± 174.930 ops/ms 179 | AsyncWithFileAppenderBenchmark.log4j2AsyncFile thrpt 4 311.078 ± 123.651 ops/ms 180 | AsyncWithFileAppenderBenchmark.logbackFile thrpt 4 1660.767 ± 4405.278 ops/ms 181 | FileAppenderBenchmark.log4j1File thrpt 4 1166.649 ± 123.377 ops/ms 182 | FileAppenderBenchmark.log4j2File thrpt 4 1214.630 ± 37.202 ops/ms 183 | FileAppenderBenchmark.logbackFile thrpt 4 1762.659 ± 1596.723 ops/ms 184 | -------------------------------------------------------------------------------- /help.txt: -------------------------------------------------------------------------------- 1 | Usage: java -jar ... [regexp*] [options] 2 | [opt] means optional argument. 3 | means required argument. 4 | "+" means comma-separated list of values. 5 | "time" arguments accept time suffixes, like "100ms". 6 | 7 | Command line options usually take precedence over annotations. 8 | 9 | [arguments] Benchmarks to run (regexp+). (default: .*) 10 | 11 | -bm Benchmark mode. Available modes are: [Throughput/thrpt, 12 | AverageTime/avgt, SampleTime/sample, SingleShotTime/ss, 13 | All/all]. (default: Throughput) 14 | 15 | -bs Batch size: number of benchmark method calls per 16 | operation. Some benchmark modes may ignore this 17 | setting, please check this separately. (default: 18 | 1) 19 | 20 | -e Benchmarks to exclude from the run. 21 | 22 | -f How many times to fork a single benchmark. Use 0 to 23 | disable forking altogether. Warning: disabling 24 | forking may have detrimental impact on benchmark 25 | and infrastructure reliability, you might want 26 | to use different warmup mode instead. (default: 27 | 5) 28 | 29 | -foe Should JMH fail immediately if any benchmark had 30 | experienced an unrecoverable error? This helps 31 | to make quick sanity tests for benchmark suites, 32 | as well as make the automated runs with checking error 33 | codes. (default: false) 34 | 35 | -gc Should JMH force GC between iterations? Forcing 36 | the GC may help to lower the noise in GC-heavy benchmarks, 37 | at the expense of jeopardizing GC ergonomics decisions. 38 | Use with care. (default: false) 39 | 40 | -h Display help, and exit. 41 | 42 | -i Number of measurement iterations to do. Measurement 43 | iterations are counted towards the benchmark score. 44 | (default: 1 for SingleShotTime, and 5 for all other 45 | modes) 46 | 47 | -jvm Use given JVM for runs. This option only affects forked 48 | runs. 49 | 50 | -jvmArgs Use given JVM arguments. Most options are inherited 51 | from the host VM options, but in some cases you want 52 | to pass the options only to a forked VM. Either single 53 | space-separated option line, or multiple options 54 | are accepted. This option only affects forked runs. 55 | 56 | -jvmArgsAppend Same as jvmArgs, but append these options after the 57 | already given JVM args. 58 | 59 | -jvmArgsPrepend Same as jvmArgs, but prepend these options before 60 | the already given JVM arg. 61 | 62 | -l List the benchmarks that match a filter, and exit. 63 | 64 | -lp List the benchmarks that match a filter, along with 65 | parameters, and exit. 66 | 67 | -lprof List profilers, and exit. 68 | 69 | -lrf List machine-readable result formats, and exit. 70 | 71 | -o Redirect human-readable output to a given file. 72 | 73 | -opi Override operations per invocation, see @OperationsPerInvocation 74 | Javadoc for details. (default: 1) 75 | 76 | -p Benchmark parameters. This option is expected to 77 | be used once per parameter. Parameter name and parameter 78 | values should be separated with equals sign. Parameter 79 | values should be separated with commas. 80 | 81 | -prof Use profilers to collect additional benchmark data. 82 | Some profilers are not available on all JVMs and/or 83 | all OSes. Please see the list of available profilers 84 | with -lprof. 85 | 86 | -r