List<T> compatibility code moved to Recyclable.Collections.Compatibility.List package. Cleanup.
This commit is contained in:
1 parent
ec69b1c406
commit
203b13268f
61 files changed
+1634
-4375
No files matched your search
@@ -1,7 +1,7 @@
|
||||
// Ignore Spelling: Poc
|
||||
|
||||
using BenchmarkDotNet.Attributes;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Collections.Benchmarks.Core;
|
||||
|
||||
#pragma warning disable CA1822
|
||||
|
||||
@@ -21,36 +21,28 @@ namespace Recyclable.Collections.Benchmarks.POC
|
||||
|
||||
public void Cleanup() { }
|
||||
|
||||
#pragma warning disable RCS1163, IDE0060
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
private static void DoNothing<T>(T item)
|
||||
{
|
||||
}
|
||||
|
||||
#pragma warning restore RCS1163
|
||||
|
||||
[Benchmark(Baseline = true)]
|
||||
public void CompareWithLess()
|
||||
{
|
||||
DoNothing(_num < 0);
|
||||
DoNothing.With(_num < 0);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
public void CompareWithAnd()
|
||||
{
|
||||
DoNothing((_num & BitShift) != 0);
|
||||
DoNothing.With((_num & BitShift) != 0);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
public void CompareWithEqual()
|
||||
{
|
||||
DoNothing(_num == -1);
|
||||
DoNothing.With(_num == -1);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
public void CompareToZero()
|
||||
{
|
||||
DoNothing(_num == 0);
|
||||
DoNothing.With(_num == 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user