Understanding the JMH

The Java Microbenchmark Harness (JMH) is an important harness and is employed in Java 9 to build all types of microbenchmarks. These benchmarks are able to analyze various functions and code sections that may work at different speeds.

The JMH allows coders to design benchmarks that can measure either faster code sections or the much slower and longer functions. It works as a harness for microbenchmarks that are prepared in Java or other languages that are being targeted for use in the JVM environment.

There are different ways of using JMH benchmarks. One approach is to use standalone projects in order to test out the individual code sections of your application. The benchmarks are able to produce the required results, ...

Get Java 9 High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.