You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During the warmup phase, the native benchmarks executor estimates the repetitions of benchmarked function calls within each measurement iteration. That number is stored in an integer variable. Given a fast enough benchmark and long enough iterationTime, the repetitions counter (called iterations in the code) may overflow, leading to negative results in a report.
@State(Scope.Benchmark)
@BenchmarkMode(Mode.AverageTime)
open class TestBenchmark {
private var x = 123L
fun nextValue(): Long {
val r = x
x = -1 * (x * 6364136223846793005 + 1442695040888963407)
return r
}
@Benchmark
fun signBenchmark(): Int = nextValue().sign
}
During the warmup phase, the native benchmarks executor estimates the repetitions of benchmarked function calls within each measurement iteration. That number is stored in an integer variable. Given a fast enough benchmark and long enough
iterationTime
, the repetitions counter (callediterations
in the code) may overflow, leading to negative results in a report.Results:
The text was updated successfully, but these errors were encountered: