From 6f498eb5267502432020c22904c34a317d60df22 Mon Sep 17 00:00:00 2001 From: LepilkinaElena Date: Mon, 21 Sep 2020 14:48:18 +0300 Subject: [PATCH] Fix for long benchmarks (#4396) --- .../main/kotlin/org/jetbrains/benchmarksLauncher/launcher.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/performance/shared/src/main/kotlin/org/jetbrains/benchmarksLauncher/launcher.kt b/performance/shared/src/main/kotlin/org/jetbrains/benchmarksLauncher/launcher.kt index f1f678bf329..e0749222915 100644 --- a/performance/shared/src/main/kotlin/org/jetbrains/benchmarksLauncher/launcher.kt +++ b/performance/shared/src/main/kotlin/org/jetbrains/benchmarksLauncher/launcher.kt @@ -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)) {