You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When defining a benchmark suite, it might occur that, for in-place operations, we want to limit the amount of evals to 1. However, for other benchmarks in the same suite, we might want to tune these benchmarks, so it makes sense to call tune! on the entire suite. However, this tries to overwrite evals in the benchmarks for which we have defined it by hand. A MWE would be:
using BenchmarkTools
mutable struct foo
data
endfunctionbar!(foo)
foo.data .=1
foo.data =map(x -> (), foo.data)
end
suite =BenchmarkGroup()
suite["bar!"] =@benchmarkablebar!(f) setup=(f=foo(ones(10))) evals=1tune!(suite)
If we call bar! on the same foo instance twice, this will throw an error because we convert the elements of foo.data to tuples, which we cannot set to 1 again. tune! tries to apply the bar! function twice to the same instance of foo, even though evals=1 is explicitly passed to the @benchmarkable. Hence, this suite can never be tune!d, which is kind of a shame. Is there a workaround around this?
The text was updated successfully, but these errors were encountered:
When defining a benchmark suite, it might occur that, for in-place operations, we want to limit the amount of
evals
to 1. However, for other benchmarks in the same suite, we might want to tune these benchmarks, so it makes sense to calltune!
on the entire suite. However, this tries to overwriteevals
in the benchmarks for which we have defined it by hand. A MWE would be:If we call
bar!
on the samefoo
instance twice, this will throw an error because we convert the elements offoo.data
to tuples, which we cannot set to1
again.tune!
tries to apply thebar!
function twice to the same instance offoo
, even thoughevals=1
is explicitly passed to the@benchmarkable
. Hence, this suite can never betune!
d, which is kind of a shame. Is there a workaround around this?The text was updated successfully, but these errors were encountered: