From 0c0682a6afecbb243dd41700162367cc588b2354 Mon Sep 17 00:00:00 2001 From: mlemanczyk Date: Sat, 10 Jun 2023 13:32:20 +0200 Subject: [PATCH 1/2] Program class fixed. --- Recyclable.Collections.Benchmarks/Program.cs | 77 +++++++------------- 1 file changed, 28 insertions(+), 49 deletions(-) diff --git a/Recyclable.Collections.Benchmarks/Program.cs b/Recyclable.Collections.Benchmarks/Program.cs index 76350ea..692922c 100644 --- a/Recyclable.Collections.Benchmarks/Program.cs +++ b/Recyclable.Collections.Benchmarks/Program.cs @@ -25,56 +25,35 @@ public static 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 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 RunSelectedBenchmarks() - { - // **************** - // *** Template *** - // **************** - var benchmark = new RecyclableCollectionsBenchmarks(); - benchmark.Setup(); - benchmark.RecyclableLongList_IndexOf_BestAndWorstCases(); - benchmark.Cleanup(); - - //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(); } } From ece6adfc1efd950da417557b52970595e5542ff9 Mon Sep 17 00:00:00 2001 From: mlemanczyk Date: Sat, 10 Jun 2023 13:42:49 +0200 Subject: [PATCH 2/2] Params changed to run all benchmarks by default. --- Recyclable.Collections.Benchmarks/POC/PocBenchmarkBase.cs | 4 ++-- Recyclable.Collections.Benchmarks/Program.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Recyclable.Collections.Benchmarks/POC/PocBenchmarkBase.cs b/Recyclable.Collections.Benchmarks/POC/PocBenchmarkBase.cs index 8565d27..522f5fa 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, RecyclableDefaults.MinItemsCountForParallelization - 1, RecyclableDefaults.MinItemsCountForParallelization, RecyclableDefaults.MinItemsCountForParallelization * 3)] //[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 692922c..9df1d4f 100644 --- a/Recyclable.Collections.Benchmarks/Program.cs +++ b/Recyclable.Collections.Benchmarks/Program.cs @@ -34,7 +34,7 @@ public static class Program //benchmark.Cleanup(); } - + static void RunPocBenchmarks() { _ = BenchmarkRunner.Run(BenchmarkConfig);