Additional benchmarks added. One-off quick smoke test added.
This commit is contained in:
1 parent
91515cb76b
commit
24a14f810b
1 file changed
+26
-4
@@ -29,8 +29,8 @@ internal class Program
|
|||||||
{
|
{
|
||||||
var benchmark = new RecyclableCollectionsBenchmarks();
|
var benchmark = new RecyclableCollectionsBenchmarks();
|
||||||
benchmark.Setup();
|
benchmark.Setup();
|
||||||
foreach (var _ in Enumerable.Range(1, 1000))
|
//foreach (var _ in Enumerable.Range(1, 1000))
|
||||||
{
|
//{
|
||||||
//benchmark.RecyclableList_Contains();
|
//benchmark.RecyclableList_Contains();
|
||||||
//benchmark.RecyclableArrayList_AddRange_WithCapacity();
|
//benchmark.RecyclableArrayList_AddRange_WithCapacity();
|
||||||
//benchmark.RecyclableArrayList_Add_WithCapacity();
|
//benchmark.RecyclableArrayList_Add_WithCapacity();
|
||||||
@@ -41,8 +41,13 @@ internal class Program
|
|||||||
//benchmark.RecyclableList_Add_WithCapacity();
|
//benchmark.RecyclableList_Add_WithCapacity();
|
||||||
//benchmark.RecyclableList_Contains_LastItems();
|
//benchmark.RecyclableList_Contains_LastItems();
|
||||||
//benchmark.RecyclableList_IndexOf_FirstItems();
|
//benchmark.RecyclableList_IndexOf_FirstItems();
|
||||||
benchmark.RecyclableList_AddRangeWhenSourceIsList();
|
//benchmark.RecyclableList_AddRangeWhenSourceIsList();
|
||||||
}
|
//benchmark.RecyclableList_Remove_FirstItems();
|
||||||
|
//benchmark.RecyclableList_RemoveAt_LastItems();
|
||||||
|
//benchmark.RecyclableList_EnsureCapacity_New_ByBlockSize();
|
||||||
|
benchmark.RecyclableList_EnsureCapacity_ByPowOf2();
|
||||||
|
//benchmark.List_RemoveAt_LastItems();
|
||||||
|
//}
|
||||||
|
|
||||||
benchmark.Cleanup();
|
benchmark.Cleanup();
|
||||||
}
|
}
|
||||||
@@ -53,6 +58,23 @@ internal class Program
|
|||||||
ManualConfig.Create(DefaultConfig.Instance).WithOptions(ConfigOptions.DisableOptimizationsValidator | ConfigOptions.JoinSummary)
|
ManualConfig.Create(DefaultConfig.Instance).WithOptions(ConfigOptions.DisableOptimizationsValidator | ConfigOptions.JoinSummary)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//var pool = ArrayPool<object>.Shared;
|
||||||
|
//for (long bufferSize = int.MaxValue / 2; bufferSize <= int.MaxValue; bufferSize += 100_000_000)
|
||||||
|
//{
|
||||||
|
// try
|
||||||
|
// {
|
||||||
|
// Console.WriteLine($"Allocating {bufferSize}");
|
||||||
|
// var arr = pool.Rent((int)bufferSize);
|
||||||
|
// pool.Return(arr);
|
||||||
|
// GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced, true, true);
|
||||||
|
// }
|
||||||
|
// catch (Exception)
|
||||||
|
// {
|
||||||
|
// Console.WriteLine($"Error during array creation. {nameof(bufferSize)} = {bufferSize}");
|
||||||
|
// throw;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
//RunBenchmark();
|
//RunBenchmark();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user