CheckOps
JMH
JMH (Java Microbenchmark Harness) is OpenJDK's GPL-2.0 harness for building, running and analysing nano, micro, milli and macro benchmarks in Java and other JVM languages.
Latest public signals
Last updated: 11 November 2026 (page expanded from the official README or site).
Introduction
JMH is a Java harness for building, running and analysing nano/micro/milli/macro benchmarks written in Java and other JVM languages. It is part of OpenJDK’s code tools. The README recommends a standalone Maven project that depends on your application’s jars so benchmarks initialise correctly.
The source code is at openjdk/jmh on GitHub under the GPL-2.0 licence, with about 2,700 stars; the most recent commit was on 14 July 2026.
JMH (Java Microbenchmark Harness) is the OpenJDK project for building, running and analysing nano, micro, milli and macro benchmarks for Java and other JVM languages. It handles JIT warm-up, dead-code elimination, forking and statistical reporting, problems that make hand-written timing loops unreliable. The README recommends a standalone Maven project that depends on your application’s jars to get reliable results.
Where it fits: on CheckOps, JMH is listed alongside alternatives such as BenchmarkDotNet, hyperfine, Gatling and JMeter. When comparing them, check licence and hosting model, how results reach developers (pull requests, CI logs or dashboards), how much tuning is needed to keep noise low, and whether the project or vendor is actively maintained.
Features
- Annotations:
@Benchmark,@State,@Warmupand more. - JIT-aware: Handles warm-up and dead-code elimination pitfalls.
- Modes: Throughput, average time, sample time and single-shot.
- Profilers: Built-in profiler integrations.
- Maven archetype: Quick project setup.
Pros
- Free to use: Open source under GPL-2.0.
- Maintained: Commits as recent as 14 July 2026.
Cons
- Micro only: Not for system load.
- Expertise needed: Correct benchmarks still require care.
Usage and Links (Example)
mvn archetype:generate -DarchetypeGroupId=org.openjdk.jmh -DarchetypeArtifactId=jmh-java-benchmark-archetype
mvn clean verify && java -jar target/benchmarks.jar
Resources:
Getting started tips: run JMH against a production-like test environment, never an unprepared shared system, and agree the target throughput and latency thresholds before the test. Start with a short smoke test, increase load gradually, watch server-side metrics alongside the tool’s client-side numbers, and keep test scripts in version control so results can be repeated and compared between releases.
Pricing
JMH is free and open source under the GPL-2.0 licence.
Recommended for?
- JVM developers measuring hot code paths.
- Library maintainers guarding performance.
- Not a fit for load testing services.
Conclusion
JMH is the standard micro-benchmark harness for the JVM.
As with any tool in this category, the value of JMH comes from running it consistently and acting on what it finds, so wire it into an existing workflow rather than treating it as an occasional audit.
Alternatives
Other tools on CheckOps that cover similar ground. Open a page, or compare one with JMH side by side.
BBenchmarkDotNetBenchmarkDotNet is the MIT-licensed .NET library for turning methods into reliable, reproducible micro-benchmarks with statistical analysis, diagnosers and exportable reports.Compare with JMH
Hhyperfinehyperfine is an Apache-2.0 command-line benchmarking tool that runs shell commands repeatedly with warm-up, statistical analysis and exports, ideal for comparing CLIs and builds.Compare with JMH
GGatlingModern Load Testing as Code.Compare with JMH
JJMeterApache JMeter open-source load testing tool for analyzing and measuring the performance of a variety of services.Compare with JMH
KK6k6 is an open-source tool and cloud service that makes load testing easy for developers and QA engineers.Compare with JMH
FFortioFortio is an Apache-2.0 Go load-testing library, CLI, echo server and web UI that runs at a fixed QPS and records latency histograms and percentiles; it began as Istio's load tester.Compare with JMH