diff --git a/Recyclable.Collections.Benchmarks/POC/PocBenchmarkBase.cs b/Recyclable.Collections.Benchmarks/POC/PocBenchmarkBase.cs index 8565d27..03805e5 100644 --- a/Recyclable.Collections.Benchmarks/POC/PocBenchmarkBase.cs +++ b/Recyclable.Collections.Benchmarks/POC/PocBenchmarkBase.cs @@ -41,10 +41,10 @@ namespace Recyclable.Collections.Benchmarks.POC // [Params(192, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144)] // [Params(524_288, 786_432, 1_048_576)] // [Params(262_144, 393_216, 524_288)] - [Params(850_000)] + //[Params(850_000)] // [Params(RecyclableDefaults.MaxPooledBlockSize)] // [Params(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 32, 40, 50, 60, 80, 90, 100, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 10_000_000, 33_554_432, 50_000_000, 100_000_000)] - //[Params(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 32, 40, 50, 60, 80, 90, 100, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, RecyclableDefaults.MinItemsCountForParallelization - 1)] + [Params(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 32, 40, 50, 60, 80, 90, 100, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072)] //[Params(RecyclableDefaults.MinItemsCountForParallelization, 1_048_576, 2_097_152, 4_194_304, 8_388_608, 16_777_216, 33_554_432, RecyclableDefaults.MaxPooledBlockSize)] // [Params(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 32, 40, 50, 60, 80, 90, 100, 128)] // [Params(RecyclableDefaults.MinItemsCountForParallelization * 3)] diff --git a/Recyclable.Collections.Benchmarks/Program.cs b/Recyclable.Collections.Benchmarks/Program.cs index 2ae0983..c77c085 100644 --- a/Recyclable.Collections.Benchmarks/Program.cs +++ b/Recyclable.Collections.Benchmarks/Program.cs @@ -3,9 +3,10 @@ using BenchmarkDotNet.Running; using Recyclable.Collections.Benchmarks; using Recyclable.Collections.Benchmarks.POC; -public class Program +public static class Program { - static IConfig BenchmarkConfig { get; } = ManualConfig.Create(DefaultConfig.Instance).WithOptions(ConfigOptions.DisableOptimizationsValidator | ConfigOptions.JoinSummary); + static IConfig BenchmarkConfig { get; } = ManualConfig.Create(DefaultConfig.Instance) + .WithOptions(ConfigOptions.DisableOptimizationsValidator | ConfigOptions.JoinSummary | ConfigOptions.KeepBenchmarkFiles); static void RunAssemblyBenchmarks() { @@ -25,56 +26,35 @@ public class Program //var benchmark = new RecyclableCollectionsBenchmarks(); //benchmark.Setup(); - static void RunAssemblyBenchmarks() - { - _ = BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(new[] { "-f*" }); - } + //foreach (var _ in Enumerable.Range(1, 1000)) + //{ + // benchmark.RecyclableLongList_Remove_FirstItems(); + // benchmark.RecyclableLongList_RemoveAt_LastItems(); + // benchmark.List_RemoveAt_LastItems(); + //} - static void RunRecyclableCollectionsBenchmarks() - { - _ = BenchmarkRunner.Run(BenchmarkConfig); - } + //benchmark.Cleanup(); + } - static void RunSelectedBenchmarks() - { - // **************** - // *** Template *** - // **************** - var benchmark = new RecyclableCollectionsBenchmarks(); - benchmark.Setup(); - benchmark.RecyclableLongList_IndexOf_BestAndWorstCases(); - benchmark.Cleanup(); + static void RunPocBenchmarks() + { + _ = BenchmarkRunner.Run(BenchmarkConfig); + _ = BenchmarkRunner.Run(BenchmarkConfig); + _ = BenchmarkRunner.Run(BenchmarkConfig); + _ = BenchmarkRunner.Run(BenchmarkConfig); + _ = BenchmarkRunner.Run(BenchmarkConfig); + _ = BenchmarkRunner.Run(BenchmarkConfig); + _ = BenchmarkRunner.Run(BenchmarkConfig); + _ = BenchmarkRunner.Run(BenchmarkConfig); + _ = BenchmarkRunner.Run(BenchmarkConfig); + // ArraySizeLimitPocBenchmarks>(BenchmarkConfig); + } - //foreach (var _ in Enumerable.Range(1, 1000)) - //{ - // benchmark.RecyclableLongList_Remove_FirstItems(); - // benchmark.RecyclableLongList_RemoveAt_LastItems(); - // benchmark.List_RemoveAt_LastItems(); - //} - - //benchmark.Cleanup(); - } - - static void RunPocBenchmarks() - { - _ = BenchmarkRunner.Run(BenchmarkConfig); - _ = BenchmarkRunner.Run(BenchmarkConfig); - _ = BenchmarkRunner.Run(BenchmarkConfig); - _ = BenchmarkRunner.Run(BenchmarkConfig); - _ = BenchmarkRunner.Run(BenchmarkConfig); - _ = BenchmarkRunner.Run(BenchmarkConfig); - _ = BenchmarkRunner.Run(BenchmarkConfig); - _ = BenchmarkRunner.Run(BenchmarkConfig); - _ = BenchmarkRunner.Run(BenchmarkConfig); - // ArraySizeLimitPocBenchmarks>(BenchmarkConfig); - } - - static void Main(string[] args) - { - RunRecyclableCollectionsBenchmarks(); - // RunPocBenchmarks(); - // RunSelectedBenchmarks(); - // RunAssemblyBenchmarks(); - } + static void Main(string[] args) + { + RunRecyclableCollectionsBenchmarks(); + // RunPocBenchmarks(); + // RunSelectedBenchmarks(); + // RunAssemblyBenchmarks(); } } diff --git a/Recyclable.Collections.Benchmarks/Recyclable.Collections.Benchmarks.csproj b/Recyclable.Collections.Benchmarks/Recyclable.Collections.Benchmarks.csproj index 59e656d..c409138 100644 --- a/Recyclable.Collections.Benchmarks/Recyclable.Collections.Benchmarks.csproj +++ b/Recyclable.Collections.Benchmarks/Recyclable.Collections.Benchmarks.csproj @@ -7,6 +7,7 @@ enable enable AnyCPU;x64 + Program