https://bz.apache.org/bugzilla/show_bug.cgi?id=67080

--- Comment #9 from Christopher Schultz <ch...@christopherschultz.net> ---
Created attachment 39050
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=39050&action=edit
JMH test to compare binarySearch to switch(scope)

# JMH version: 1.37
# VM version: JDK 21, OpenJDK 64-Bit Server VM, 21+35-2513
# VM invoker:
/Library/Java/JavaVirtualMachines/jdk-21.jdk/Contents/Home/bin/java
# VM options: <none>
# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false
to disable)
# Warmup: 5 iterations, 5 s each
# Measurement: 5 iterations, 5 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: org.sample.ScopeLookup.binarySearch

# Run progress: 0.00% complete, ETA 00:01:40
# Fork: 1 of 1
# Warmup Iteration   1: 32873899.937 ops/s
# Warmup Iteration   2: 32037578.845 ops/s
# Warmup Iteration   3: 32101040.458 ops/s
# Warmup Iteration   4: 32619813.449 ops/s
# Warmup Iteration   5: 32459923.794 ops/s
Iteration   1: 32878096.534 ops/s
Iteration   2: 32782993.884 ops/s
Iteration   3: 32802020.501 ops/s
Iteration   4: 32357564.918 ops/s
Iteration   5: 34414429.950 ops/s


Result "org.sample.ScopeLookup.binarySearch":
  33047021.158 ±(99.9%) 3046287.685 ops/s [Average]
  (min, avg, max) = (32357564.918, 33047021.158, 34414429.950), stdev =
791111.238
  CI (99.9%): [30000733.472, 36093308.843] (assumes normal distribution)


# JMH version: 1.37
# VM version: JDK 21, OpenJDK 64-Bit Server VM, 21+35-2513
# VM invoker:
/Library/Java/JavaVirtualMachines/jdk-21.jdk/Contents/Home/bin/java
# VM options: <none>
# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false
to disable)
# Warmup: 5 iterations, 5 s each
# Measurement: 5 iterations, 5 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: org.sample.ScopeLookup.caseSearch

# Run progress: 50.00% complete, ETA 00:00:50
# Fork: 1 of 1
# Warmup Iteration   1: 45942620.330 ops/s
# Warmup Iteration   2: 43150765.515 ops/s
# Warmup Iteration   3: 44932581.558 ops/s
# Warmup Iteration   4: 45360554.270 ops/s
# Warmup Iteration   5: 43506970.095 ops/s
Iteration   1: 44393187.971 ops/s
Iteration   2: 46287069.970 ops/s
Iteration   3: 46461809.778 ops/s
Iteration   4: 45619371.053 ops/s
Iteration   5: 46167433.097 ops/s


Result "org.sample.ScopeLookup.caseSearch":
  45785774.374 ±(99.9%) 3233722.237 ops/s [Average]
  (min, avg, max) = (44393187.971, 45785774.374, 46461809.778), stdev =
839787.396
  CI (99.9%): [42552052.137, 49019496.610] (assumes normal distribution)


# Run complete. Total time: 00:01:41

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 new VM 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.

Benchmark                  Mode  Cnt         Score         Error  Units
ScopeLookup.binarySearch  thrpt    5  33047021.158 ± 3046287.685  ops/s
ScopeLookup.caseSearch    thrpt    5  45785774.374 ± 3233722.237  ops/s

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to