Benchmarking Java code with JMH
Introduction In this post, we take a look at how to benchmark Java code using JMH. JMH is a tool or harness as they call it to benchmark code running on the JVM. The tool takes care of warm-ups, can prevent code optimizations, and running multiple variations of the benchmarks.
Dependencies To use JMH in your project include the following dependencies in your pom.xml file.
1 2 3 4 5 6 7 8 9 10 <dependency> <groupId>org.