Collections.Benchmarks.Core package updated. Bug fixes. Logo added.

This commit is contained in:
mlemanczyk committed 2023-10-22 13:05:31 +02:00
1 parent fd38907eaa
commit 4f0102438e
17 files changed
+346 -67

No files matched your search

@@ -1,10 +1,12 @@
using Collections.Benchmarks.Core;
namespace Recyclable.Collections.Benchmarks
namespace Recyclable.Collections.Compatibility.List.Benchmarks
{
public class BinarySearchBenchmarks<T> : CollectionsBenchmarksBase<T>
public class BinarySearchBenchmarks : RecyclableCollectionsCompatibilityListBenchmarks
{
public void Array_BinarySearch_BestAndWorstCases()
public override string MethodNameSuffix => "_BinarySearch";
public void Array_BinarySearch()
{
var data = TestObjects;
var list = TestObjects;
@@ -16,7 +18,7 @@ namespace Recyclable.Collections.Benchmarks
}
}
public void List_BinarySearch_BestAndWorstCases()
public void List_BinarySearch()
{
var data = TestObjects;
var list = TestObjectsAsList;
@@ -28,7 +30,7 @@ namespace Recyclable.Collections.Benchmarks
}
}
public void PooledList_BinarySearch_BestAndWorstCases()
public void PooledList_BinarySearch()
{
var data = TestObjects;
var list = TestObjectsAsPooledList;
@@ -40,7 +42,7 @@ namespace Recyclable.Collections.Benchmarks
}
}
public void RecyclableList_BinarySearch_BestAndWorstCases()
public void RecyclableList_BinarySearch()
{
var data = TestObjects;
var list = TestObjectsAsRecyclableList;
@@ -52,7 +54,7 @@ namespace Recyclable.Collections.Benchmarks
}
}
// public void RecyclableLongList_BinarySearch_BestAndWorstCases()
// public void RecyclableLongList_BinarySearch()
// {
// var data = TestObjects;
// var list = TestObjectsAsRecyclableLongList;
@@ -1,9 +1,11 @@
using Collections.Benchmarks.Core;
namespace Recyclable.Collections.Benchmarks
namespace Recyclable.Collections.Compatibility.List.Benchmarks
{
public class ConvertAllBenchmarks<T> : CollectionsBenchmarksBase<T>
public class ConvertAllBenchmarks : RecyclableCollectionsCompatibilityListBenchmarks
{
public override string MethodNameSuffix => "_ConvertAll";
public void Array_ConvertAll()
{
var data = TestObjects;
@@ -1,9 +1,11 @@
using Collections.Benchmarks.Core;
namespace Recyclable.Collections.Benchmarks
namespace Recyclable.Collections.Compatibility.List.Benchmarks
{
public partial class RecyclableCollectionsCompatibilityListBenchmarks
public class ExistsBenchmarks : RecyclableCollectionsCompatibilityListBenchmarks
{
public override string MethodNameSuffix => "_Exists_BestAndWorstCases";
public void Array_Exists_BestAndWorstCases()
{
var data = TestObjects;
@@ -1,9 +1,11 @@
using Collections.Benchmarks.Core;
namespace Recyclable.Collections.Benchmarks
namespace Recyclable.Collections.Compatibility.List.Benchmarks
{
public partial class RecyclableCollectionsCompatibilityListBenchmarks
public class FindAllBenchmarks : RecyclableCollectionsCompatibilityListBenchmarks
{
public override string MethodNameSuffix => "_FindAll_BestAndWorstCases";
public void Array_FindAll_BestAndWorstCases()
{
var data = TestObjects;
@@ -1,9 +1,11 @@
using Collections.Benchmarks.Core;
namespace Recyclable.Collections.Benchmarks
namespace Recyclable.Collections.Compatibility.List.Benchmarks
{
public partial class RecyclableCollectionsCompatibilityListBenchmarks : CollectionsBenchmarksBase<CollectionsBenchmarksSource>
public class FindLastIndexBenchmarks : RecyclableCollectionsCompatibilityListBenchmarks
{
public override string MethodNameSuffix => "_FindLastIndex_BestAndWorstCases";
public void Array_FindLastIndex_BestAndWorstCases()
{
var data = TestObjects;
@@ -1,9 +1,11 @@
using Collections.Benchmarks.Core;
namespace Recyclable.Collections.Benchmarks
namespace Recyclable.Collections.Compatibility.List.Benchmarks
{
public partial class RecyclableCollectionsCompatibilityListBenchmarks
public class FindLastBenchmarks : RecyclableCollectionsCompatibilityListBenchmarks
{
public override string MethodNameSuffix => "_FindLast_BestAndWorstCases";
public void Array_FindLast_BestAndWorstCases()
{
var data = TestObjects;
@@ -1,9 +1,11 @@
using Collections.Benchmarks.Core;
namespace Recyclable.Collections.Benchmarks
namespace Recyclable.Collections.Compatibility.List.Benchmarks
{
public partial class RecyclableCollectionsCompatibilityListBenchmarks
public class FindBenchmarks: RecyclableCollectionsCompatibilityListBenchmarks
{
public override string MethodNameSuffix => "_Find_BestAndWorstCases";
public void Array_Find_BestAndWorstCases()
{
var data = TestObjects;
@@ -1,2 +1,25 @@
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Running;
namespace Recyclable.Collections.Compatibility.List.Benchmarks
{
public static class Program
{
static IConfig BenchmarkConfig { get; } = ManualConfig.Create(DefaultConfig.Instance)
.WithOptions(ConfigOptions.DisableOptimizationsValidator | ConfigOptions.JoinSummary);
static void Main()
{
BenchmarkRunner.Run(new[]
{
typeof(BinarySearchBenchmarks),
typeof(ConvertAllBenchmarks),
typeof(ExistsBenchmarks),
typeof(FindBenchmarks),
typeof(FindAllBenchmarks),
typeof(FindLastBenchmarks),
typeof(FindLastIndexBenchmarks)
}, BenchmarkConfig);
}
}
}
@@ -1,15 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Collections.Benchmarks.Core" Version="0.0.2" />
<PackageReference Include="Recyclable.Collections" Version="0.0.6" />
<PackageReference Include="Collections.Benchmarks.Core" Version="0.0.4" />
<PackageReference Include="Recyclable.Collections" Version="0.0.6.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Recyclable.Collections.Compatibility.List\Recyclable.Collections.Compatibility.List.csproj" />
</ItemGroup>
</Project>
@@ -0,0 +1,23 @@
using BenchmarkDotNet.Attributes;
using Collections.Benchmarks.Core;
namespace Recyclable.Collections.Compatibility.List.Benchmarks
{
public partial class RecyclableCollectionsCompatibilityListBenchmarks : DataDrivenBenchmarksBase<CollectionsBenchmarksSource>
{
[Params(CollectionsBenchmarksSource.Array)]
public override CollectionsBenchmarksSource BaseDataType { get => base.BaseDataType; set => base.BaseDataType = value; }
[Params(
CollectionsBenchmarksSource.List,
CollectionsBenchmarksSource.PooledList,
CollectionsBenchmarksSource.RecyclableList
)]
public override CollectionsBenchmarksSource DataType { get => base.DataType; set => base.DataType = value; }
//[Params(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 32, 40, RecyclableDefaults.MinPooledArrayLength - 1, RecyclableDefaults.MinPooledArrayLength, 40, 50, 60, 70, 80, 90, 100, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, RecyclableDefaults.MinItemsCountForParallelization)]
[Params(RecyclableDefaults.MinPooledArrayLength, RecyclableDefaults.MinItemsCountForParallelization)]
public override int TestObjectCount { get => base.TestObjectCount; set => base.TestObjectCount = value; }
}
}