Skip to content

Conversation

@JimmyWang6
Copy link
Contributor

@JimmyWang6 JimmyWang6 commented Jan 15, 2026

KAFKA-20060 This PR
refactors the JMH benchmarks module to remove dependencies on test
utilities from the kafka-server module and replaces them with
appropriate alternatives from the test infrastructure or new utility
classes.

Reviewers: Chia-Ping Tsai chia7712@gmail.com

@JimmyWang6 JimmyWang6 marked this pull request as draft January 15, 2026 12:34
@github-actions github-actions bot added triage PRs from the community performance build Gradle build or GitHub Actions labels Jan 15, 2026
@JimmyWang6 JimmyWang6 marked this pull request as ready for review January 22, 2026 08:04
@chia7712
Copy link
Member

# Benchmark: org.apache.kafka.jmh.fetcher.ReplicaFetcherThreadBenchmark.testFetcher
# Parameters: (partitionCount = 100)

# Run progress: 0.00% complete, ETA 00:13:20
# Fork: 1 of 1
# Warmup Iteration   1: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Mockito is currently self-attaching to enable the inline-mock-maker. This will no longer work in future releases of the JDK. Please add Mockito as an agent to your build as described in Mockito's documentation: https://javadoc.io/doc/org.mockito/mockito-core/latest/org.mockito/org/mockito/Mockito.html#0.3
WARNING: A Java agent has been loaded dynamically (/tmp/byteBuddyAgent4576711464579738126.jar)
WARNING: If a serviceability tool is in use, please run with -XX:+EnableDynamicAgentLoading to hide this warning
WARNING: If a serviceability tool is not in use, please run with -Djdk.instrument.traceUsage for more information
WARNING: Dynamic loading of agents will be disallowed by default in a future release
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
3288.054 ns/op
# Warmup Iteration   2: 3181.216 ns/op
# Warmup Iteration   3: 3177.999 ns/op
# Warmup Iteration   4: 3169.900 ns/op
# Warmup Iteration   5: 3177.211 ns/op
Iteration   1: 3169.360 ns/op
Iteration   2: 3167.125 ns/op
Iteration   3: 3158.947 ns/op
Iteration   4: 3147.598 ns/op
Iteration   5: 3149.771 ns/op
Iteration   6: 3147.262 ns/op
Iteration   7: 3169.074 ns/op
Iteration   8: 3162.815 ns/op
Iteration   9: 3157.850 ns/op
Iteration  10: 3178.198 ns/op
Iteration  11: 3173.644 ns/op
# Benchmark: org.apache.kafka.jmh.server.PartitionCreationBench.makeFollower
# Parameters: (numPartitions = 20, useTopicIds = false)

# Run progress: 0.00% complete, ETA 00:10:00
# Fork: 1 of 3
# Warmup Iteration   1: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
5.274 ms/op
# Warmup Iteration   2: 3.787 ms/op
# Warmup Iteration   3: 4.378 ms/op
# Warmup Iteration   4: 3.466 ms/op
# Warmup Iteration   5: 3.450 ms/op
Iteration   1: 2.756 ms/op
Iteration   2: 2.557 ms/op
Iteration   3: 2.588 ms/op
Iteration   4: 2.547 ms/op
# Benchmark: org.apache.kafka.jmh.server.CheckpointBench.measureCheckpointHighWatermarks
# Parameters: (numPartitions = 3, numTopics = 100)

# Run progress: 0.00% complete, ETA 00:30:00
# Fork: 1 of 3
# Warmup Iteration   1: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
0.470 ops/ms
# Warmup Iteration   2: 1.079 ops/ms
# Warmup Iteration   3: 1.139 ops/ms
# Warmup Iteration   4: 0.538 ops/ms
# Warmup Iteration   5: 0.024 ops/ms
Iteration   1: 0.463 ops/ms
Iteration   2: 1.132 ops/ms
Iteration   3: 0.945 ops/ms
Iteration   4: 0.017 ops/ms
Iteration   5: 0.023 ops/ms

the modified benchmark files pass on my local.

@chia7712 chia7712 changed the title KAFKA-20060: Drop core test output dependency in jmh-benchmarks KAFKA-20060 Drop core test output dependency in jmh-benchmarks Jan 22, 2026
@chia7712 chia7712 merged commit ed367cf into apache:trunk Jan 22, 2026
25 checks passed
@github-actions github-actions bot removed the triage PRs from the community label Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Gradle build or GitHub Actions ci-approved performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants