dotnet / dotnet/BenchmarkDotNet

High error rates across benchmark runs

Open
#1,484 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
11.5k
Forks
1.1k
Avg merge
6d 11h
Merged PRs (30d)
12

Description

I have a nice set of benchmarks (which you can see [here](https://github.com/microsoft/coyote/tree/master/Tests/Performance.Tests/Tests/Actors/StateMachines)) and they run fine, and report nice low error rates around 0.2 to 2% range.

But when I do the same benchmark run over and over (on the same machine of course) then compare the error range across all of these runs, the picture is not so nice with amount of discrepancy across runs ranging up to 20%. This shows 10 invocations of my benchmark runner and you can see each iteration is nice and stable with small standard deviations (shown in light blue), but the steps across each iteration are unexpected:

![image](https://user-images.githubusercontent.com/18707114/85812716-40a5e980-b716-11ea-8ce2-f852edbf3200.png)

What is worse, when I run those 10 iterations again, I get completely different set of steps, showing that this is completely random noise of some kind:

![image](https://user-images.githubusercontent.com/18707114/85813299-a646a580-b717-11ea-8766-2dc873a49152.png)

So while one benchmark run has nice small standard deviations, the test is not repeatable, which makes it really hard to use this for performance regression testing. Any ideas how I can improve this?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.