Fix for long benchmarks (#4396)

This commit is contained in:
LepilkinaElena
2020-09-21 14:48:18 +03:00
committed by GitHub
parent 9f457dce80
commit 6f498eb526
@@ -81,7 +81,10 @@ abstract class Launcher {
if (benchmark.useAutoEvaluatedNumberOfMeasure) {
val time = runBenchmark(benchmarkInstance, benchmark, 1)
if (time < expectedDuration)
autoEvaluatedNumberOfMeasureIteration = (expectedDuration / time).toInt() / 4 * 4
// Made auto evaluated number of measurements to be a multiple of 4.
// Loops which iteration number is a multiple of 4 execute optimally,
// because of different optimizations on processor (e.g. LSD)
autoEvaluatedNumberOfMeasureIteration = ((expectedDuration / time).toInt() / 4 + 1) * 4
}
logger.log("Running benchmark $name ")
for (k in 0.until(numberOfAttempts)) {