Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Add OpenJDK JMH for creating microbenchmarks in JMeter code #5960

Merged
merged 1 commit into from Jun 2, 2023

Conversation

vlsi
Copy link
Collaborator

@vlsi vlsi commented Jun 2, 2023

Description

This enables creating benchmark for tracking performance of low-level code.

The way to add a benchmark is to add src/jmh folder (side by side with src/main). Then benchmark jar can be generated with ./gradlew jmhJar, or the benchmark can be executed from IDE if there's a corresponding main method.

See ResultCollectorBenchmark

Motivation and Context

We need measure performance for optimizations we make. For instance, improvements to properties, synchronization, etc should be validated.

Here's a sample output for ResultCollectorBenchmark:

Benchmark                                                    (success)  Mode  Cnt   Score    Error   Units
ResultCollectorBenchmark.isSampleWanted                           true  avgt    5   7,039 ±  0,160   ns/op
ResultCollectorBenchmark.isSampleWanted:·gc.alloc.rate            true  avgt    5  ≈ 10⁻³           MB/sec
ResultCollectorBenchmark.isSampleWanted:·gc.alloc.rate.norm       true  avgt    5  ≈ 10⁻⁶             B/op
ResultCollectorBenchmark.isSampleWanted:·gc.count                 true  avgt    5     ≈ 0           counts

@vlsi vlsi added this to the 5.6 milestone Jun 2, 2023
@vlsi vlsi changed the title test: Added OpenJDK JMH for creating microbenchmarks in JMeter code test: Add OpenJDK JMH for creating microbenchmarks in JMeter code Jun 2, 2023
This enables creating benchmark for tracking performance of low-level code.

The way to add a benchmark is to add src/jmh folder (side by side with src/main).
Then benchmark jar can be generated with ./gradlew jmhJar, or the benchmark
can be executed from IDE if there's a corresponding main method.

See ResultCollectorBenchmark
@vlsi vlsi merged commit a2690e8 into apache:master Jun 2, 2023
7 checks passed
@vlsi vlsi deleted the jmh branch June 2, 2023 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant