I thought that BenchmarkTools was designed to be able to test simple, fast-running functions by evaluating them multiple times to avoid issues with the timing precision.
Using the example from the README, it doesn’t appear to me that it’s actually executing the function for each evaluation. Am I misunderstanding something?
julia> @benchmark sin(1) evals=1
BenchmarkTools.Trial:
memory estimate: 0 bytes
allocs estimate: 0
--------------
minimum time: 18.000 ns (0.00% GC)
median time: 20.000 ns (0.00% GC)
mean time: 19.785 ns (0.00% GC)
maximum time: 39.000 ns (0.00% GC)
--------------
samples: 10000
evals/sample: 1
julia> @benchmark sin(1) evals=1000
BenchmarkTools.Trial:
memory estimate: 0 bytes
allocs estimate: 0
--------------
minimum time: 0.017 ns (0.00% GC)
median time: 0.020 ns (0.00% GC)
mean time: 0.020 ns (0.00% GC)
maximum time: 0.035 ns (0.00% GC)
--------------
samples: 10000
evals/sample: 1000
julia> @benchmark sin(1) evals=1000000
BenchmarkTools.Trial:
memory estimate: 0 bytes
allocs estimate: 0
--------------
minimum time: 0.001 ns (0.00% GC)
median time: 0.001 ns (0.00% GC)
mean time: 0.001 ns (0.00% GC)
maximum time: 0.001 ns (0.00% GC)
--------------
samples: 10000
evals/sample: 1000000