The JVM optimizes the application by creating an application behavior profile. A plug is created to reset this profile. Otherwise, do:
benchmarkFoo(); benchmarkBar();
may lead to different measurements than
benchmarkBar(); benchmarkFoo();
since the profile of the first standard affects the second.
Time determines the length of the JMH's costs to warm up or run the test. If these points are short, your virtual machine will not be warm enough, or your result may have too high a standard deviation.
Rafael winterhalter
source share