easybench-rs
easybench-rs copied to clipboard
allow functions in bench_env to own the parameter
I saw that bench_env and gen_env both give the function to be benchmarked a mutable reference, not the actual value. Is there a reason for this?
If we passed ownership of the environment to the closure, the environment would be dropped before the closure returns, and the time taken to run the destructor would be included in the results. For large environments, this can be significant.