Skip to content

Commit 1d1e86e

Browse files
committed
Updated benchmarks
1 parent 175c529 commit 1d1e86e

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

src/Pitcher.Benchmarks/Benchmarks/ArgumentOutOfRangeBenchmarks.cs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,53 @@ public void ThrowArgumentOutOfRangeWhen()
4545
{
4646
}
4747
}
48+
49+
[Benchmark]
50+
public void ThrowArgumentOutOfRangeWhenNegativeNumber()
51+
{
52+
try
53+
{
54+
Throw.ArgumentOutOfRange.WhenNegativeNumber(-1, "foo", "bar");
55+
}
56+
catch
57+
{
58+
}
59+
}
60+
61+
[Benchmark]
62+
public void ThrowArgumentOutOfRangeWhenPositiveNumber()
63+
{
64+
try
65+
{
66+
Throw.ArgumentOutOfRange.WhenNegativeNumber(1, "foo", "bar");
67+
}
68+
catch
69+
{
70+
}
71+
}
72+
73+
[Benchmark]
74+
public void ThrowArgumentOutOfRangeWhenLessThan()
75+
{
76+
try
77+
{
78+
Throw.ArgumentOutOfRange.WhenLessThan(0, 1, "foo", "bar");
79+
}
80+
catch
81+
{
82+
}
83+
}
84+
85+
[Benchmark]
86+
public void ThrowArgumentOutOfRangeWhenMoreThan()
87+
{
88+
try
89+
{
90+
Throw.ArgumentOutOfRange.WhenMoreThan(1, 0, "foo", "bar");
91+
}
92+
catch
93+
{
94+
}
95+
}
4896
}
4997
}

src/Pitcher.Benchmarks/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ private static IConfig GetConfig()
2121
config.Add(BenchmarkDotNet.Diagnosers.MemoryDiagnoser.Default);
2222

2323
config.Add(Job.ShortRun.With(CsProjCoreToolchain.NetCoreApp20).AsBaseline());
24+
config.Add(Job.ShortRun.With(CsProjCoreToolchain.NetCoreApp30));
2425
config.Add(Job.ShortRun.With(CsProjClassicNetToolchain.Net47));
2526

2627
return config;

0 commit comments

Comments
 (0)