Small cleanup
This commit is contained in:
1 parent
bb878caa39
commit
53d759586e
5 files changed
+12
-12
No files matched your search
@@ -4,25 +4,25 @@ namespace Recyclable.Collections.Benchmarks
|
|||||||
{
|
{
|
||||||
public partial class RecyclableCollectionsBenchmarks
|
public partial class RecyclableCollectionsBenchmarks
|
||||||
{
|
{
|
||||||
public void List_Create()
|
public static void List_Create()
|
||||||
{
|
{
|
||||||
var list = new List<long>();
|
var list = new List<long>();
|
||||||
DoNothing(list);
|
DoNothing(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PooledList_Create()
|
public static void PooledList_Create()
|
||||||
{
|
{
|
||||||
using var list = new PooledList<long>(ClearMode.Auto);
|
using var list = new PooledList<long>(ClearMode.Auto);
|
||||||
DoNothing(list);
|
DoNothing(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RecyclableArrayList_Create()
|
public static void RecyclableArrayList_Create()
|
||||||
{
|
{
|
||||||
using var list = new RecyclableArrayList<long>();
|
using var list = new RecyclableArrayList<long>();
|
||||||
DoNothing(list);
|
DoNothing(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RecyclableList_Create()
|
public static void RecyclableList_Create()
|
||||||
{
|
{
|
||||||
using var list = new RecyclableList<long>();
|
using var list = new RecyclableList<long>();
|
||||||
DoNothing(list);
|
DoNothing(list);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace Recyclable.Collections.Benchmarks.POC
|
|||||||
{
|
{
|
||||||
var benchmark = new ArraySizeLimitPocBenchmarks();
|
var benchmark = new ArraySizeLimitPocBenchmarks();
|
||||||
benchmark.Setup();
|
benchmark.Setup();
|
||||||
benchmark.FindArraySizeLimit();
|
FindArraySizeLimit();
|
||||||
benchmark.Cleanup();
|
benchmark.Cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ namespace Recyclable.Collections.Benchmarks.POC
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Benchmark(OperationsPerInvoke = 1)]
|
[Benchmark(OperationsPerInvoke = 1)]
|
||||||
public void FindArraySizeLimit()
|
public static void FindArraySizeLimit()
|
||||||
{
|
{
|
||||||
var pool = ArrayPool<long>.Shared;
|
var pool = ArrayPool<long>.Shared;
|
||||||
var bufferSize = int.MaxValue / 2;
|
var bufferSize = int.MaxValue / 2;
|
||||||
|
|||||||
@@ -23,12 +23,12 @@ namespace Recyclable.Collections.Benchmarks.POC
|
|||||||
set => _baselineMethod = value;
|
set => _baselineMethod = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Benchmark]
|
|
||||||
public void RunWhen() => TestMethod.Invoke();
|
|
||||||
|
|
||||||
[Benchmark(Baseline = true)]
|
[Benchmark(Baseline = true)]
|
||||||
public void Baseline() => BaselineMethod.Invoke();
|
public void Baseline() => BaselineMethod.Invoke();
|
||||||
|
|
||||||
|
[Benchmark]
|
||||||
|
public void Actual() => TestMethod.Invoke();
|
||||||
|
|
||||||
// 0 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524_288
|
// 0 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524_288
|
||||||
// 1048576 2097152 4194304 8388608 16777216 33554432 67108864 134217728 268435456 536870912
|
// 1048576 2097152 4194304 8388608 16777216 33554432 67108864 134217728 268435456 536870912
|
||||||
// 1073741824 2147483648
|
// 1073741824 2147483648
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ internal class Program
|
|||||||
private static void Main(string[] args)
|
private static void Main(string[] args)
|
||||||
{
|
{
|
||||||
RunRecyclableCollectionsBenchmarks();
|
RunRecyclableCollectionsBenchmarks();
|
||||||
//RunPocBenchmarks();
|
// RunPocBenchmarks();
|
||||||
//RunSelectedBenchmarks();
|
// RunSelectedBenchmarks();
|
||||||
//RunAssemblyBenchmarks();
|
//RunAssemblyBenchmarks();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,7 @@ namespace Recyclable.Collections.Parallel
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
context.AllDoneSignal.AddParticipant();
|
_ = context.AllDoneSignal.AddParticipant();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user