Skip to content

Commit

Permalink
Use InnerIterationCount for perf tests
Browse files Browse the repository at this point in the history
Commit migrated from dotnet/corefx@b729933
  • Loading branch information
GrabYourPitchforks authored and joshfree committed Mar 6, 2018
1 parent 10a4d23 commit 5d436c4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/libraries/System.Memory/tests/Performance/Perf.Span.Clear.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ namespace System.Memory.Tests
{
public class Perf_Span_Clear
{
[Benchmark]
private const int NumIters = 10000;

[Benchmark(InnerIterationCount = NumIters)]
[InlineData(0)]
[InlineData(1)]
[InlineData(2)]
Expand Down Expand Up @@ -41,15 +43,15 @@ public void Int(int size)
{
using (iteration.StartMeasurement())
{
for (int i = 0; i < 10000; i++)
for (int i = 0; i < Benchmark.InnerIterationCount; i++)
{
span.Clear();
}
}
}
}

[Benchmark]
[Benchmark(InnerIterationCount = NumIters)]
[InlineData(0)]
[InlineData(1)]
[InlineData(2)]
Expand Down Expand Up @@ -81,7 +83,7 @@ public void References(int size)
{
using (iteration.StartMeasurement())
{
for (int i = 0; i < 10000; i++)
for (int i = 0; i < Benchmark.InnerIterationCount; i++)
{
span.Clear();
}
Expand Down

0 comments on commit 5d436c4

Please sign in to comment.