JMH – the OpenJDK tool
Java Microbenchmark Harness (JMH) is a small library developed by the OpenJDK team—yes, the same one doing the JVM—which enables you to easily develop microbenchmarks.
A microbenchmark designs a benchmark on a very small part of an application. Most of the time, you can see it as a unit benchmark, using the analogy with unit tests.
Yet, it is something important when setting up performance tests as it will allow you to quickly identify a critical performance regression introduced by a recent change. The idea is to associate each benchmark with a small part of code, whereas a benchmark will include several layers. So, if the benchmark fails, you will spend a lot of time identifying why, instead of simply checking the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access