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
Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.
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.
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:
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.
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