From 0667fc0e974ad3fb2cdd49de7ed5d8c3a1b1b1bb Mon Sep 17 00:00:00 2001 From: Samuel Badr Date: Wed, 6 Mar 2024 22:16:48 +0100 Subject: [PATCH] delete branch for the case that reduction is the dominant part in the benchmark --- src/benchmarking.jl | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/benchmarking.jl b/src/benchmarking.jl index b258d9b0..8ed391e3 100644 --- a/src/benchmarking.jl +++ b/src/benchmarking.jl @@ -40,13 +40,7 @@ function benchmark(init, setup, f, teardown; evals::Union{Int, Nothing}=nothing, # We should be spending about 5% of runtime on calibration. # If we spent less than 1% then recalibrate with more evals. calibration2 = nothing - if calibration1.time < .00015seconds # This branch protects us against cases where runtime is dominated by the reduction. - calibration2, time = bench(10) - trials = floor(Int, .05seconds/(calibration2.time+1e-9)) - if trials > 20 - calibration2, time = bench(trials) - end - elseif calibration1.time < .01seconds + if calibration1.time < .01seconds calibration2, time = bench(floor(Int, .05seconds/(calibration1.time+1e-9))) end