-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathIntroOutliers.cs
More file actions
33 lines (30 loc) · 965 Bytes
/
IntroOutliers.cs
File metadata and controls
33 lines (30 loc) · 965 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System.Threading;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Jobs;
using Perfolizer.Mathematics.OutlierDetection;
namespace BenchmarkDotNet.Samples
{
[Config(typeof(Config))]
[UseLocalJobOnly]
public class IntroOutliers
{
private class Config : ManualConfig
{
public Config()
{
var jobBase = Job.Default.WithWarmupCount(0).WithIterationCount(10).WithInvocationCount(1).WithUnrollFactor(1);
AddJob(jobBase.WithOutlierMode(OutlierMode.DontRemove).WithId("DontRemoveOutliers"));
AddJob(jobBase.WithOutlierMode(OutlierMode.RemoveUpper).WithId("RemoveUpperOutliers"));
}
}
private int counter;
[Benchmark]
public void Foo()
{
counter++;
int noise = counter % 10 == 0 ? 500 : 0;
Thread.Sleep(100 + noise);
}
}
}