-
Notifications
You must be signed in to change notification settings - Fork 102
Open
Description
Hi there,
maybe I miss something completely, but I do not understand the meaning of samples
and evals
for the benchmarks.
If I run this code in REPL
using BenchmarkTools
BenchmarkTools.DEFAULT_PARAMETERS.samples = 1
BenchmarkTools.DEFAULT_PARAMETERS.evals = 1
foo_calls = 0
function foo()
global foo_calls += 1
end
b = @benchmark foo()
@show foo_calls
b
it should, as I understood the documentation, evaluate foo
once. However, it produces
foo_calls = 501494
BenchmarkTools.Trial: 1 sample with 993 evaluations.
Single result which took 37.263 ns (0.00% GC) to evaluate,
with a memory estimate of 16 bytes, over 1 allocations.
Why does it evaluate foo
993 times while it was called in reality 501494 times?
Metadata
Metadata
Assignees
Labels
No labels