# JMH version: 1.36 # VM version: JDK 18.0.1.1, Java HotSpot(TM)64-Bit Server VM, 18.0.1.1+2-6 # VM invoker: D:\program\jdk-18.0.1.1\bin\java.exe # VM options: -javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2022.3.2\lib\idea_rt.jar=5220:C:\Program Files\JetBrains\IntelliJ IDEA 2022.3.2\bin -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 # Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable) # Warmup: 3 iterations, 10 s each # Measurement: 5 iterations, 10 s each # Timeout: 10 min per iteration # Threads: 1 thread, will synchronize iterations # Benchmark mode: Average time, time/op # Benchmark: com.panther.DB.jmh.sample.stringAdd
Result "com.panther.DB.jmh.sample.stringAdd": 225.843 ±(99.9%) 294.688 ms/op [Average] (min, avg, max) = (141.599, 225.843, 321.151), stdev = 76.529// 执行的最小、平均、最大、误差值 CI (99.9%): [≈ 0, 520.531] (assumes normal distribution)
# JMH version: 1.36 # VM version: JDK 18.0.1.1, Java HotSpot(TM)64-Bit Server VM, 18.0.1.1+2-6 # VM invoker: D:\program\jdk-18.0.1.1\bin\java.exe # VM options: -javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2022.3.2\lib\idea_rt.jar=5220:C:\Program Files\JetBrains\IntelliJ IDEA 2022.3.2\bin -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 # Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable) # Warmup: 3 iterations, 10 s each # Measurement: 5 iterations, 10 s each # Timeout: 10 min per iteration # Threads: 1 thread, will synchronize iterations # Benchmark mode: Average time, time/op # Benchmark: com.panther.DB.jmh.sample.stringBuilderAppend
Result "com.panther.DB.jmh.sample.stringBuilderAppend": 6.014 ±(99.9%) 3.349 ms/op [Average] (min, avg, max) = (5.077, 6.014, 7.213), stdev = 0.870 CI (99.9%): [2.666, 9.363] (assumes normal distribution)
# Run complete. Total time: 00:02:43
REMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on why the numbers are the way they are. Use profilers(see -prof, -lprof), design factorial experiments, perform baseline and negative tests that provide experimental control, make sure the benchmarking environment is safe on JVM/OS/HW level, ask for reviews from the domain experts. Do not assume the numbers tell you what you want them to tell.
NOTE: Current JVM experimentally supports Compiler Blackholes, and they are in use. Please exercise extra caution when trusting the results, look into the generated code to check the benchmark still works, and factor in a small probability of newVM bugs. Additionally, while comparisons between different JVMs are already problematic, the performance difference caused by different Blackhole modes can be very significant. Please make sure you use the consistent Blackhole mode for comparisons.