frankvicky commented on PR #18917:
URL: https://github.com/apache/kafka/pull/18917#issuecomment-2688312404
It's weird that `oldImplHashCodeBenchmark` slows after the first warmup, so
I benchmark with JDK17 again.
However, the behavior is identical.
```
BUILD SUCCESSFUL in 10s
94 actionable tasks: 3 executed, 91 up-to-date
gradle build done
running JMH with args: TopicIdPartitionBenchmark
# JMH version: 1.37
# VM version: JDK 17.0.14, OpenJDK 64-Bit Server VM, 17.0.14+7-LTS
# VM invoker: /home/frankvicky/.sdkman/candidates/java/17.0.14-zulu/bin/java
# VM options: <none>
# Blackhole mode: compiler (auto-detected, use
-Djmh.blackhole.autoDetect=false to disable)
# Warmup: 5 iterations, 10 s each
# Measurement: 10 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark:
org.apache.kafka.jmh.common.TopicIdPartitionBenchmark.oldImplEqualsBenchmark
# Run progress: 0.00% complete, ETA 00:10:00
# Fork: 1 of 1
# Warmup Iteration 1: 0.723 ns/op
# Warmup Iteration 2: 0.679 ns/op
# Warmup Iteration 3: 0.712 ns/op
# Warmup Iteration 4: 0.721 ns/op
# Warmup Iteration 5: 0.725 ns/op
Iteration 1: 0.686 ns/op
Iteration 2: 0.677 ns/op
Iteration 3: 0.689 ns/op
Iteration 4: 0.714 ns/op
Iteration 5: 0.721 ns/op
Iteration 6: 0.723 ns/op
Iteration 7: 0.721 ns/op
Iteration 8: 0.721 ns/op
Iteration 9: 0.717 ns/op
Iteration 10: 0.683 ns/op
Result
"org.apache.kafka.jmh.common.TopicIdPartitionBenchmark.oldImplEqualsBenchmark":
0.705 ±(99.9%) 0.028 ns/op [Average]
(min, avg, max) = (0.677, 0.705, 0.723), stdev = 0.019
CI (99.9%): [0.677, 0.734] (assumes normal distribution)
# JMH version: 1.37
# VM version: JDK 17.0.14, OpenJDK 64-Bit Server VM, 17.0.14+7-LTS
# VM invoker: /home/frankvicky/.sdkman/candidates/java/17.0.14-zulu/bin/java
# VM options: <none>
# Blackhole mode: compiler (auto-detected, use
-Djmh.blackhole.autoDetect=false to disable)
# Warmup: 5 iterations, 10 s each
# Measurement: 10 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark:
org.apache.kafka.jmh.common.TopicIdPartitionBenchmark.oldImplHashCodeBenchmark
# Run progress: 25.00% complete, ETA 00:07:30
# Fork: 1 of 1
# Warmup Iteration 1: 0.733 ns/op
# Warmup Iteration 2: 4.979 ns/op
# Warmup Iteration 3: 4.577 ns/op
# Warmup Iteration 4: 4.546 ns/op
# Warmup Iteration 5: 4.547 ns/op
Iteration 1: 4.535 ns/op
Iteration 2: 4.545 ns/op
Iteration 3: 4.450 ns/op
Iteration 4: 4.558 ns/op
Iteration 5: 4.556 ns/op
Iteration 6: 4.554 ns/op
Iteration 7: 4.544 ns/op
Iteration 8: 4.545 ns/op
Iteration 9: 4.435 ns/op
Iteration 10: 4.452 ns/op
Result
"org.apache.kafka.jmh.common.TopicIdPartitionBenchmark.oldImplHashCodeBenchmark":
4.517 ±(99.9%) 0.076 ns/op [Average]
(min, avg, max) = (4.435, 4.517, 4.558), stdev = 0.050
CI (99.9%): [4.441, 4.593] (assumes normal distribution)
# JMH version: 1.37
# VM version: JDK 17.0.14, OpenJDK 64-Bit Server VM, 17.0.14+7-LTS
# VM invoker: /home/frankvicky/.sdkman/candidates/java/17.0.14-zulu/bin/java
# VM options: <none>
# Blackhole mode: compiler (auto-detected, use
-Djmh.blackhole.autoDetect=false to disable)
# Warmup: 5 iterations, 10 s each
# Measurement: 10 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark:
org.apache.kafka.jmh.common.TopicIdPartitionBenchmark.recordEqualsBenchmark
# Run progress: 50.00% complete, ETA 00:05:00
# Fork: 1 of 1
# Warmup Iteration 1: 0.608 ns/op
# Warmup Iteration 2: 0.462 ns/op
# Warmup Iteration 3: 0.619 ns/op
# Warmup Iteration 4: 0.449 ns/op
# Warmup Iteration 5: 0.457 ns/op
Iteration 1: 0.477 ns/op
Iteration 2: 0.479 ns/op
Iteration 3: 0.480 ns/op
Iteration 4: 0.480 ns/op
Iteration 5: 0.477 ns/op
Iteration 6: 0.473 ns/op
Iteration 7: 0.474 ns/op
Iteration 8: 0.478 ns/op
Iteration 9: 0.479 ns/op
Iteration 10: 0.478 ns/op
Result
"org.apache.kafka.jmh.common.TopicIdPartitionBenchmark.recordEqualsBenchmark":
0.478 ±(99.9%) 0.003 ns/op [Average]
(min, avg, max) = (0.473, 0.478, 0.480), stdev = 0.002
CI (99.9%): [0.474, 0.481] (assumes normal distribution)
# JMH version: 1.37
# VM version: JDK 17.0.14, OpenJDK 64-Bit Server VM, 17.0.14+7-LTS
# VM invoker: /home/frankvicky/.sdkman/candidates/java/17.0.14-zulu/bin/java
# VM options: <none>
# Blackhole mode: compiler (auto-detected, use
-Djmh.blackhole.autoDetect=false to disable)
# Warmup: 5 iterations, 10 s each
# Measurement: 10 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark:
org.apache.kafka.jmh.common.TopicIdPartitionBenchmark.recordHashCodeBenchmark
# Run progress: 75.00% complete, ETA 00:02:30
# Fork: 1 of 1
# Warmup Iteration 1: 0.705 ns/op
# Warmup Iteration 2: 0.503 ns/op
# Warmup Iteration 3: 0.509 ns/op
# Warmup Iteration 4: 0.494 ns/op
# Warmup Iteration 5: 0.525 ns/op
Iteration 1: 0.522 ns/op
Iteration 2: 0.505 ns/op
Iteration 3: 0.493 ns/op
Iteration 4: 0.514 ns/op
Iteration 5: 0.528 ns/op
Iteration 6: 0.526 ns/op
Iteration 7: 0.525 ns/op
Iteration 8: 0.519 ns/op
Iteration 9: 0.503 ns/op
Iteration 10: 0.524 ns/op
Result
"org.apache.kafka.jmh.common.TopicIdPartitionBenchmark.recordHashCodeBenchmark":
0.516 ±(99.9%) 0.018 ns/op [Average]
(min, avg, max) = (0.493, 0.516, 0.528), stdev = 0.012
CI (99.9%): [0.498, 0.534] (assumes normal distribution)
# Run complete. Total time: 00:10:00
Benchmark Mode Cnt Score Error
Units
TopicIdPartitionBenchmark.oldImplEqualsBenchmark avgt 10 0.705 ± 0.028
ns/op
TopicIdPartitionBenchmark.oldImplHashCodeBenchmark avgt 10 4.517 ± 0.076
ns/op
TopicIdPartitionBenchmark.recordEqualsBenchmark avgt 10 0.478 ± 0.003
ns/op
TopicIdPartitionBenchmark.recordHashCodeBenchmark avgt 10 0.516 ± 0.018
ns/op
JMH benchmarks done
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]