BenchmarkTools.jl icon indicating copy to clipboard operation
BenchmarkTools.jl copied to clipboard

Reproducible randomness in setup for BenchmarkGroups

Open gustaphe opened this issue 4 years ago • 2 comments

When working with random numbers or would be useful to have a way to guarantee that each benchmark in a group uses the same series of numbers. Unless I'm mistaken there is no way to do this now.

If BenchmarkGroup had a property setup::Function which was evaluated for each Benchmark, one could use setup=()->seed! (1234) to make sure that the benchmark runs use the same sets of numbers.

Or setupcould be an Expr so you could create a new rng.

gustaphe avatar Mar 19 '21 06:03 gustaphe

Wanna try a PR @gustaphe ?

gdalle avatar Sep 18 '23 18:09 gdalle

@gdalle Sure

gustaphe avatar Sep 21 '23 15:09 gustaphe