Skip to content

Commit

Permalink
ensure that only one eval is used for the warmup, test deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
willow-ahrens committed Jan 4, 2024
1 parent 8665689 commit f796677
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/execution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function _run(b::Benchmark, p::Parameters; verbose=false, pad="", kwargs...)
params.gctrial && gcscrub()
start_time = Base.time()
trial = Trial(params)
b.samplefunc(b.quote_vals, params) #warmup sample
b.samplefunc(b.quote_vals, Parameters(params, evals=1)) #warmup sample
params.gcsample && gcscrub()
s = b.samplefunc(b.quote_vals, params)
push!(trial, s[1:(end - 1)]...)
Expand Down Expand Up @@ -181,6 +181,7 @@ function _lineartrial(b::Benchmark, p::Parameters=b.params; maxevals=RESOLUTION,
params = Parameters(p; kwargs...)
estimates = zeros(maxevals)
completed = 0
params.evals = 1
b.samplefunc(b.quote_vals, params) #warmup sample
params.gctrial && gcscrub()
start_time = time()
Expand Down
2 changes: 2 additions & 0 deletions test/ExecutionTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ tune!(b_pass)
# warmup #
###########

@test_deprecated warmup(@benchmarkable sin(1))

is_warm = false
function needs_warm()
global is_warm
Expand Down

0 comments on commit f796677

Please sign in to comment.