How to go about implementing adaptive warmups in JMH (in Scala)

57 Views Asked by At

I'm currently getting started in integrating JMH into a Scala Project and would like to implement a way to do adaptive warmups. What do I mean by apative warmups? Instead of defining a fixed number of warmup iterations, I would like to automatically determine the number of warmups it takes to get a stable runtime and then start measuring.

Has anyone already implemented this feature or is there a good reason why nobody did?

My naive attempt would be running a benchmark without warmup iterations, checking when runtimes seem to stabilize and if they don't try again with more iterations until the output seems stable. This number of iterations would then be used as the warmup iteration value when doing the actual measurements.

0

There are 0 best solutions below