Skip to content

Commit

Permalink
delete branch for the case that reduction is the dominant part in the…
Browse files Browse the repository at this point in the history
… benchmark
  • Loading branch information
SamuelBadr committed Mar 6, 2024
1 parent 392e132 commit 0667fc0
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/benchmarking.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 0667fc0

Please sign in to comment.