Table of Contents

Class AutoWarmupStoppingCriteria

Namespace
BenchmarkDotNet.Engines
Assembly
BenchmarkDotNet.dll

Automatically choose the best number of iterations during the warmup stage.

public class AutoWarmupStoppingCriteria : StoppingCriteriaBase, IStoppingCriteria
Inheritance
AutoWarmupStoppingCriteria
Implements
Inherited Members

Constructors

AutoWarmupStoppingCriteria(int, int, int)

The idea of the implementation is simple: if measurements monotonously decrease or increase, the steady state is not achieved; we should continue the warmup stage. The evaluation method counts "fluctuations" (3 consecutive measurements A,B,C where (A>B AND B<C) OR (A<B AND B>C)) until the required amount of flotations is observed.

public AutoWarmupStoppingCriteria(int minIterationCount, int maxIterationCount, int minFluctuationCount = 4)

Parameters

minIterationCount int

The minimum number of iterations. We are always going to do at least minIterationCount iterations regardless of fluctuations.

maxIterationCount int

The maximum number of iterations. We are always going to do at most maxIterationCount iterations regardless of fluctuations.

minFluctuationCount int

The required number of fluctuations. If the required number of fluctuations is achieved but the number of iterations less than minIterationCount, we need more iterations. If the required number of fluctuations is not achieved but the number of iterations equal to maxIterationCount, we should stop the iterations.

Methods

Evaluate(IReadOnlyList<Measurement>)

Checks do we have enough iterations

public override StoppingResult Evaluate(IReadOnlyList<Measurement> measurements)

Parameters

measurements IReadOnlyList<Measurement>

Returns

StoppingResult

GetMaxIterationCount()

protected override int GetMaxIterationCount()

Returns

int

GetTitle()

protected override string GetTitle()

Returns

string

GetWarnings()

protected override IEnumerable<string> GetWarnings()

Returns

IEnumerable<string>