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
Hello!
I would like to report that using [IterationSetup] is causing 400B to be allocated.
I quickly checked how it works for earlier versions and it seems that the problem started in 0.13.6 and persists in 0.13.12.
using BenchmarkDotNet.Attributes;
BenchmarkDotNet.Running.BenchmarkRunner.Run<Test>();
[MemoryDiagnoser]
public class Test
{
[IterationSetup]
public void TestSetup()
{
}
[Benchmark]
public void TestBenchmark()
{
}
}
If I remove IterationSetup or change it to GlobalSetup, the problem does not occur.
This is because [IterationSetup] causes the benchmark method to be invoked only once. Removing it allows it to be invoked multiple times. There are background allocations that we cannot control (see dotnet/runtime#101536), and more benchmark invocations drowns those out.
#2562 will improve it somewhat, but will not completely eliminate the issue. The runtime will need to remove the background allocations to completely fix it, and that's out of our control.
Hello!
I would like to report that using [IterationSetup] is causing 400B to be allocated.
I quickly checked how it works for earlier versions and it seems that the problem started in 0.13.6 and persists in 0.13.12.
Please check the summary and code below:
If I remove IterationSetup or change it to GlobalSetup, the problem does not occur.
Thanks!
The text was updated successfully, but these errors were encountered: