November 2017
Intermediate to advanced
398 pages
10h 14m
English
There are several problems that may occur while using microbenchmarks. Here, we explain these problems and then present the benefits that you gain, when you switch to using the JMH. The JMH is specially designed to provide the best answers for these typical problems.
The first problem is that of the absence of a warm-up phase. Normal benchmarking may suffer from this problem. The Java interpreter is able to work out that all requests should be compiled just in time, which goes against the warm-up principle.
This problem is usually resolved by running the benchmark code several times before actually taking a measurement. This wastes time, since no important activity has taken place during the ...