Of course, depending on what you want to show such a "warm-up" is or is not appropriate.
Though I propose to have a loop for(int i=0;i<100;i++) doTheTest(); around the core test methods.
This gives the Java-VM time to identify the method doTheTest() to be a hotspot and then to JIT-compile it for the next invocation.
Finally you have 100 measurement results. Propose to publish the first one as e.g. "Java cold" and an average of the last 10 ones as "Java warm / JIT compiled".
Of course, depending on what you want to show such a "warm-up" is or is not appropriate.
Though I propose to have a loop
for(int i=0;i<100;i++) doTheTest();
around the core test methods. This gives the Java-VM time to identify the methoddoTheTest()
to be a hotspot and then to JIT-compile it for the next invocation.Finally you have 100 measurement results. Propose to publish the first one as e.g. "Java cold" and an average of the last 10 ones as "Java warm / JIT compiled".