diff --git a/Recyclable.Collections.Benchmarks/POC/EqualVsContainsInConsecutiveOrderBenchmarks.cs b/Recyclable.Collections.Benchmarks/POC/EqualVsContainsInConsecutiveOrderBenchmarks.cs new file mode 100644 index 0000000..b1c2a55 --- /dev/null +++ b/Recyclable.Collections.Benchmarks/POC/EqualVsContainsInConsecutiveOrderBenchmarks.cs @@ -0,0 +1,40 @@ +using BenchmarkDotNet.Attributes; +using FluentAssertions; +using Recyclable.CollectionsTests; + +namespace Recyclable.Collections.Benchmarks.POC +{ + + public class EqualVsContainsInConsecutiveOrderBenchmarks : IDisposable + { + private const int TestItemsCount = 10000; + + private readonly IEnumerable _list1 = RecyclableLongListTestData.CreateTestData(TestItemsCount).ToRecyclableList(); + private readonly IEnumerable _list2 = RecyclableLongListTestData.CreateTestData(TestItemsCount).ToArray(); + + [Benchmark(Baseline = true)] + public void Equal() + { + _ = _list1.Should().Equal(_list2); + } + + [Benchmark] + public void ContainsInConsecutiveOrder() + { + _ = _list1.Should().ContainInConsecutiveOrder(_list2); + } + + public void Dispose() + { + if (_list1 is IDisposable disposable1) + { + disposable1.Dispose(); + } + + if (_list2 is IDisposable disposable2) + { + disposable2.Dispose(); + } + } + } +} diff --git a/Recyclable.Collections.Benchmarks/Program.cs b/Recyclable.Collections.Benchmarks/Program.cs index 12b6c6e..6b80bdb 100644 --- a/Recyclable.Collections.Benchmarks/Program.cs +++ b/Recyclable.Collections.Benchmarks/Program.cs @@ -49,6 +49,7 @@ namespace Recyclable.Collections.Benchmarks _ = BenchmarkRunner.Run(BenchmarkConfig); _ = BenchmarkRunner.Run(BenchmarkConfig); _ = BenchmarkRunner.Run(BenchmarkConfig); + _ = BenchmarkRunner.Run(BenchmarkConfig); // ArraySizeLimitPocBenchmarks>(BenchmarkConfig); }