diff --git a/Collections.Pooled.Benchmarks/Collections.Pooled.Benchmarks.csproj b/Collections.Pooled.Benchmarks/Collections.Pooled.Benchmarks.csproj index 8b291e7..49ee1c5 100644 --- a/Collections.Pooled.Benchmarks/Collections.Pooled.Benchmarks.csproj +++ b/Collections.Pooled.Benchmarks/Collections.Pooled.Benchmarks.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.2;net472 + net472;net6.0;net7.0;net8.0 7.3 true true @@ -10,7 +10,7 @@ - + diff --git a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.Add.cs b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.Add.cs index 083a44f..caf2bd7 100644 --- a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.Add.cs +++ b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.Add.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using System.Collections.Generic; +using BenchmarkDotNet.Jobs; namespace Collections.Pooled.Benchmarks.PooledDictionary { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Dict_Add : DictBase { diff --git a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.Constructors.cs b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.Constructors.cs index cab679f..c564069 100644 --- a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.Constructors.cs +++ b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.Constructors.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledDictionary { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Dict_Constructors : DictBase { diff --git a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsBase.cs b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsBase.cs index 2478d0b..bb56113 100644 --- a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsBase.cs +++ b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsBase.cs @@ -1,6 +1,5 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledDictionary { diff --git a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsKey_Int_False.cs b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsKey_Int_False.cs index 8514881..90f0c95 100644 --- a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsKey_Int_False.cs +++ b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsKey_Int_False.cs @@ -1,14 +1,12 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; namespace Collections.Pooled.Benchmarks.PooledDictionary { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] public class Dict_ContainsKey_Int_False : DictContainsBase { [Benchmark(Baseline = true)] diff --git a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsKey_Int_True.cs b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsKey_Int_True.cs index cabb469..bb39110 100644 --- a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsKey_Int_True.cs +++ b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsKey_Int_True.cs @@ -1,14 +1,12 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; namespace Collections.Pooled.Benchmarks.PooledDictionary { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] public class Dict_ContainsKey_Int_True : DictContainsBase { [Benchmark(Baseline = true)] diff --git a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsKey_String_False.cs b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsKey_String_False.cs index ed34a17..b7e281a 100644 --- a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsKey_String_False.cs +++ b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsKey_String_False.cs @@ -1,14 +1,12 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; namespace Collections.Pooled.Benchmarks.PooledDictionary { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] public class Dict_ContainsKey_String_False : DictContainsBase { [Benchmark(Baseline = true)] diff --git a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsKey_String_False_IgnoreCase.cs b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsKey_String_False_IgnoreCase.cs index 20e6352..4875057 100644 --- a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsKey_String_False_IgnoreCase.cs +++ b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsKey_String_False_IgnoreCase.cs @@ -1,14 +1,14 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledDictionary { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] public class Dict_ContainsKey_String_False_IgnoreCase : DictContainsBase { [Benchmark(Baseline = true)] @@ -31,7 +31,7 @@ public void PooledContainsKey_String_False_IgnoreCase() protected override string GetT(int i) => i.ToString(); - protected override IEqualityComparer Comparer + protected override IEqualityComparer Comparer => StringComparer.OrdinalIgnoreCase; } } diff --git a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsKey_String_True.cs b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsKey_String_True.cs index 57506ff..ba9a4c1 100644 --- a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsKey_String_True.cs +++ b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsKey_String_True.cs @@ -1,15 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Linq; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Linq; namespace Collections.Pooled.Benchmarks.PooledDictionary { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] public class Dict_ContainsKey_String_True : DictContainsBase { [Benchmark(Baseline = true)] diff --git a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsValue_Int_False.cs b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsValue_Int_False.cs index a9e4bed..5c2313a 100644 --- a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsValue_Int_False.cs +++ b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsValue_Int_False.cs @@ -1,14 +1,12 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; namespace Collections.Pooled.Benchmarks.PooledDictionary { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] public class Dict_ContainsValue_Int_False : DictContainsBase { [Benchmark(Baseline = true)] diff --git a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsValue_Int_True.cs b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsValue_Int_True.cs index 71e7b83..29aaddf 100644 --- a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsValue_Int_True.cs +++ b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsValue_Int_True.cs @@ -1,14 +1,12 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; namespace Collections.Pooled.Benchmarks.PooledDictionary { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] public class Dict_ContainsValue_Int_True : DictContainsBase { [Benchmark(Baseline = true)] diff --git a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsValue_String_False.cs b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsValue_String_False.cs index 02fdf4f..4ece2a9 100644 --- a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsValue_String_False.cs +++ b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsValue_String_False.cs @@ -1,14 +1,12 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; namespace Collections.Pooled.Benchmarks.PooledDictionary { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] public class Dict_ContainsValue_String_False : DictContainsBase { [Benchmark(Baseline = true)] diff --git a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsValues_String_True.cs b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsValues_String_True.cs index d4b54bc..4e495b3 100644 --- a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsValues_String_True.cs +++ b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.ContainsValues_String_True.cs @@ -1,15 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Linq; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Linq; namespace Collections.Pooled.Benchmarks.PooledDictionary { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] public class Dict_ContainsValue_String_True : DictContainsBase { [Benchmark(Baseline = true)] diff --git a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.Enumeration_ValueType.cs b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.Enumeration_ValueType.cs index da28911..d0dc6c1 100644 --- a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.Enumeration_ValueType.cs +++ b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.Enumeration_ValueType.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledDictionary { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Dict_Enumeration_ValueType : DictBase { diff --git a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.GetItem.cs b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.GetItem.cs index c2df6db..405ab98 100644 --- a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.GetItem.cs +++ b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.GetItem.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledDictionary { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Dict_GetItem : DictBase { diff --git a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.GetKeys.cs b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.GetKeys.cs index 74031af..d3d1c82 100644 --- a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.GetKeys.cs +++ b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.GetKeys.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledDictionary { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Dict_GetKeys : DictBase { diff --git a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.Indexer_get_ValueType.cs b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.Indexer_get_ValueType.cs index 13cefa4..c374e62 100644 --- a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.Indexer_get_ValueType.cs +++ b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.Indexer_get_ValueType.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledDictionary { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Dict_Indexer_get_ValueType : DictBase { diff --git a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.Remove.cs b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.Remove.cs index 81eb249..533288a 100644 --- a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.Remove.cs +++ b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.Remove.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledDictionary { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Dict_Remove : DictBase { diff --git a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.SetItem.cs b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.SetItem.cs index 7a762d7..9297f99 100644 --- a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.SetItem.cs +++ b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.SetItem.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledDictionary { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Dict_SetItem : DictBase { diff --git a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.TryGetValue.cs b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.TryGetValue.cs index 7202b51..7be4ab9 100644 --- a/Collections.Pooled.Benchmarks/PooledDictionary/Dict.TryGetValue.cs +++ b/Collections.Pooled.Benchmarks/PooledDictionary/Dict.TryGetValue.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using System.Collections.Generic; +using BenchmarkDotNet.Jobs; namespace Collections.Pooled.Benchmarks.PooledDictionary { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Dict_TryGetValue : DictBase { diff --git a/Collections.Pooled.Benchmarks/PooledDictionary/DictBase.cs b/Collections.Pooled.Benchmarks/PooledDictionary/DictBase.cs index fab2b91..5065023 100644 --- a/Collections.Pooled.Benchmarks/PooledDictionary/DictBase.cs +++ b/Collections.Pooled.Benchmarks/PooledDictionary/DictBase.cs @@ -1,6 +1,5 @@ -using System; +using System; using System.Collections.Generic; -using System.Text; namespace Collections.Pooled.Benchmarks.PooledDictionary { @@ -15,7 +14,7 @@ protected static Dictionary CreateDictionary(int size) while (dict.Count < size) { int key = rand.Next(500000, int.MaxValue); -#if NETCOREAPP2_2 +#if NET8_0_OR_GREATER dict.TryAdd(key, 0); #else if (!dict.ContainsKey(key)) diff --git a/Collections.Pooled.Benchmarks/PooledDictionary/StringHashing.cs b/Collections.Pooled.Benchmarks/PooledDictionary/StringHashing.cs index ef5b730..79e52b9 100644 --- a/Collections.Pooled.Benchmarks/PooledDictionary/StringHashing.cs +++ b/Collections.Pooled.Benchmarks/PooledDictionary/StringHashing.cs @@ -1,14 +1,14 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledDictionary { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] public class StringHashing : DictBase { [Benchmark(Baseline = true)] diff --git a/Collections.Pooled.Benchmarks/PooledList/List.Add.cs b/Collections.Pooled.Benchmarks/PooledList/List.Add.cs index 7983f79..3b35c13 100644 --- a/Collections.Pooled.Benchmarks/PooledList/List.Add.cs +++ b/Collections.Pooled.Benchmarks/PooledList/List.Add.cs @@ -1,6 +1,6 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledList { @@ -8,11 +8,10 @@ namespace Collections.Pooled.Benchmarks.PooledList // prevents us from running CoreJob with a CLR host, or ClrJob with a Core host. // When this is resolved, should change all the tests to run both job types at the same time. -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class List_Add : ListBase { diff --git a/Collections.Pooled.Benchmarks/PooledList/List.AddRange.cs b/Collections.Pooled.Benchmarks/PooledList/List.AddRange.cs index b822cce..c27d4fa 100644 --- a/Collections.Pooled.Benchmarks/PooledList/List.AddRange.cs +++ b/Collections.Pooled.Benchmarks/PooledList/List.AddRange.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledList { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class List_AddRange : ListBase { @@ -56,7 +55,7 @@ public void PooledAddRangeIEnumerable() private IEnumerable IntEnumerable() { - for (int i=0; i < N; i++) + for (int i = 0; i < N; i++) yield return list[i]; } diff --git a/Collections.Pooled.Benchmarks/PooledList/List.AddRange_Int_CapacityIncrease.cs b/Collections.Pooled.Benchmarks/PooledList/List.AddRange_Int_CapacityIncrease.cs index b27ebbb..da93d6c 100644 --- a/Collections.Pooled.Benchmarks/PooledList/List.AddRange_Int_CapacityIncrease.cs +++ b/Collections.Pooled.Benchmarks/PooledList/List.AddRange_Int_CapacityIncrease.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledList { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class List_AddRange_Int_CapacityIncrease : ListBase { diff --git a/Collections.Pooled.Benchmarks/PooledList/List.AddRange_Int_NoCapacityIncrease.cs b/Collections.Pooled.Benchmarks/PooledList/List.AddRange_Int_NoCapacityIncrease.cs index 24e88af..213d7df 100644 --- a/Collections.Pooled.Benchmarks/PooledList/List.AddRange_Int_NoCapacityIncrease.cs +++ b/Collections.Pooled.Benchmarks/PooledList/List.AddRange_Int_NoCapacityIncrease.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledList { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class List_AddRange_Int_NoCapacityIncrease : ListBase { diff --git a/Collections.Pooled.Benchmarks/PooledList/List.AddRange_String_CapacityIncrease.cs b/Collections.Pooled.Benchmarks/PooledList/List.AddRange_String_CapacityIncrease.cs index f1942b4..f046583 100644 --- a/Collections.Pooled.Benchmarks/PooledList/List.AddRange_String_CapacityIncrease.cs +++ b/Collections.Pooled.Benchmarks/PooledList/List.AddRange_String_CapacityIncrease.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledList { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class List_AddRange_String_CapacityIncrease : ListBase { diff --git a/Collections.Pooled.Benchmarks/PooledList/List.AddRange_String_NoCapacityIncrease.cs b/Collections.Pooled.Benchmarks/PooledList/List.AddRange_String_NoCapacityIncrease.cs index 83cf081..bfab701 100644 --- a/Collections.Pooled.Benchmarks/PooledList/List.AddRange_String_NoCapacityIncrease.cs +++ b/Collections.Pooled.Benchmarks/PooledList/List.AddRange_String_NoCapacityIncrease.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledList { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class List_AddRange_String_NoCapacityIncrease : ListBase { diff --git a/Collections.Pooled.Benchmarks/PooledList/List.Add_Types.cs b/Collections.Pooled.Benchmarks/PooledList/List.Add_Types.cs index f4241c5..40cc13d 100644 --- a/Collections.Pooled.Benchmarks/PooledList/List.Add_Types.cs +++ b/Collections.Pooled.Benchmarks/PooledList/List.Add_Types.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledList { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class List_Add_Types : ListBase { diff --git a/Collections.Pooled.Benchmarks/PooledList/List.BinarySearch.cs b/Collections.Pooled.Benchmarks/PooledList/List.BinarySearch.cs index 72354d3..b30de4c 100644 --- a/Collections.Pooled.Benchmarks/PooledList/List.BinarySearch.cs +++ b/Collections.Pooled.Benchmarks/PooledList/List.BinarySearch.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledList { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class List_BinarySearch : ListBase { diff --git a/Collections.Pooled.Benchmarks/PooledList/List.Clear.cs b/Collections.Pooled.Benchmarks/PooledList/List.Clear.cs index 721686e..61be74e 100644 --- a/Collections.Pooled.Benchmarks/PooledList/List.Clear.cs +++ b/Collections.Pooled.Benchmarks/PooledList/List.Clear.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledList { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class List_Clear : ListBase { diff --git a/Collections.Pooled.Benchmarks/PooledList/List.Constructors.cs b/Collections.Pooled.Benchmarks/PooledList/List.Constructors.cs index 6c61b6f..5239c6a 100644 --- a/Collections.Pooled.Benchmarks/PooledList/List.Constructors.cs +++ b/Collections.Pooled.Benchmarks/PooledList/List.Constructors.cs @@ -1,18 +1,17 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledList { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class List_Constructors : ListBase { - [Benchmark(Baseline=true)] + [Benchmark(Baseline = true)] public void ListICollectionConstructor() { if (Type == ListType.Int) diff --git a/Collections.Pooled.Benchmarks/PooledList/List.Contains.cs b/Collections.Pooled.Benchmarks/PooledList/List.Contains.cs index f320c33..85d8e57 100644 --- a/Collections.Pooled.Benchmarks/PooledList/List.Contains.cs +++ b/Collections.Pooled.Benchmarks/PooledList/List.Contains.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledList { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class List_Contains : ListBase { diff --git a/Collections.Pooled.Benchmarks/PooledList/List.Contains_Types.cs b/Collections.Pooled.Benchmarks/PooledList/List.Contains_Types.cs index c405b2d..77335a1 100644 --- a/Collections.Pooled.Benchmarks/PooledList/List.Contains_Types.cs +++ b/Collections.Pooled.Benchmarks/PooledList/List.Contains_Types.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledList { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class List_Contains_Types : ListBase { diff --git a/Collections.Pooled.Benchmarks/PooledList/List.Enumerator.cs b/Collections.Pooled.Benchmarks/PooledList/List.Enumerator.cs index 8f7e7a7..bb51224 100644 --- a/Collections.Pooled.Benchmarks/PooledList/List.Enumerator.cs +++ b/Collections.Pooled.Benchmarks/PooledList/List.Enumerator.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledList { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class List_Enumerator : ListBase { diff --git a/Collections.Pooled.Benchmarks/PooledList/List.GetRange.cs b/Collections.Pooled.Benchmarks/PooledList/List.GetRange.cs index df8e839..b91f290 100644 --- a/Collections.Pooled.Benchmarks/PooledList/List.GetRange.cs +++ b/Collections.Pooled.Benchmarks/PooledList/List.GetRange.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledList { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class List_GetRange : ListBase { diff --git a/Collections.Pooled.Benchmarks/PooledList/List.IndexOf_ReferenceType.cs b/Collections.Pooled.Benchmarks/PooledList/List.IndexOf_ReferenceType.cs index ea5fa0d..a89838c 100644 --- a/Collections.Pooled.Benchmarks/PooledList/List.IndexOf_ReferenceType.cs +++ b/Collections.Pooled.Benchmarks/PooledList/List.IndexOf_ReferenceType.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledList { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class List_IndexOf_ReferenceType : ListBase { diff --git a/Collections.Pooled.Benchmarks/PooledList/List.IndexOf_ValueType.cs b/Collections.Pooled.Benchmarks/PooledList/List.IndexOf_ValueType.cs index 604515c..12ac531 100644 --- a/Collections.Pooled.Benchmarks/PooledList/List.IndexOf_ValueType.cs +++ b/Collections.Pooled.Benchmarks/PooledList/List.IndexOf_ValueType.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledList { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class List_IndexOf_ValueType : ListBase { @@ -44,7 +43,7 @@ public void GlobalSetup() list = new List(N); pooled = new PooledList(N); - for (int i=0; i < N; i++) + for (int i = 0; i < N; i++) { list.Add(i); pooled.Add(i); diff --git a/Collections.Pooled.Benchmarks/PooledList/List.Indexer_Types.cs b/Collections.Pooled.Benchmarks/PooledList/List.Indexer_Types.cs index ec1a324..58e8dbd 100644 --- a/Collections.Pooled.Benchmarks/PooledList/List.Indexer_Types.cs +++ b/Collections.Pooled.Benchmarks/PooledList/List.Indexer_Types.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledList { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class List_Indexer_Types : ListBase { diff --git a/Collections.Pooled.Benchmarks/PooledList/List.Insert.cs b/Collections.Pooled.Benchmarks/PooledList/List.Insert.cs index 9363549..51758b0 100644 --- a/Collections.Pooled.Benchmarks/PooledList/List.Insert.cs +++ b/Collections.Pooled.Benchmarks/PooledList/List.Insert.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledList { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class List_Insert : ListBase { diff --git a/Collections.Pooled.Benchmarks/PooledList/List.Remove.cs b/Collections.Pooled.Benchmarks/PooledList/List.Remove.cs index 667b167..e4b7765 100644 --- a/Collections.Pooled.Benchmarks/PooledList/List.Remove.cs +++ b/Collections.Pooled.Benchmarks/PooledList/List.Remove.cs @@ -1,19 +1,19 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledList { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class List_Remove : ListBase { [IterationSetup(Target = nameof(ListRemove_Int))] - public void SetupListInt() + public void SetupListInt() => listInt = new List(intItems); [Benchmark(Baseline = true)] @@ -65,7 +65,7 @@ public void PooledRemove_Int() } [IterationSetup(Target = nameof(ListRemove_String))] - public void SetupListString() + public void SetupListString() => listString = new List(stringItems); [Benchmark] diff --git a/Collections.Pooled.Benchmarks/PooledList/List.Reverse.cs b/Collections.Pooled.Benchmarks/PooledList/List.Reverse.cs index de75f30..b7ad25f 100644 --- a/Collections.Pooled.Benchmarks/PooledList/List.Reverse.cs +++ b/Collections.Pooled.Benchmarks/PooledList/List.Reverse.cs @@ -1,14 +1,14 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledList { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class List_Reverse : ListBase { diff --git a/Collections.Pooled.Benchmarks/PooledList/List.SetCapacity.cs b/Collections.Pooled.Benchmarks/PooledList/List.SetCapacity.cs index 64701fc..8cf185a 100644 --- a/Collections.Pooled.Benchmarks/PooledList/List.SetCapacity.cs +++ b/Collections.Pooled.Benchmarks/PooledList/List.SetCapacity.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledList { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class List_Capacity : ListBase { diff --git a/Collections.Pooled.Benchmarks/PooledList/List.Sort.cs b/Collections.Pooled.Benchmarks/PooledList/List.Sort.cs index 80d205e..9b09952 100644 --- a/Collections.Pooled.Benchmarks/PooledList/List.Sort.cs +++ b/Collections.Pooled.Benchmarks/PooledList/List.Sort.cs @@ -1,14 +1,14 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledList { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class List_Sort : ListBase { diff --git a/Collections.Pooled.Benchmarks/PooledList/List.Span.cs b/Collections.Pooled.Benchmarks/PooledList/List.Span.cs index 7ac1b3c..2591003 100644 --- a/Collections.Pooled.Benchmarks/PooledList/List.Span.cs +++ b/Collections.Pooled.Benchmarks/PooledList/List.Span.cs @@ -1,14 +1,12 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; namespace Collections.Pooled.Benchmarks.PooledList { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class List_Span : ListBase { diff --git a/Collections.Pooled.Benchmarks/PooledList/List.ToArray.cs b/Collections.Pooled.Benchmarks/PooledList/List.ToArray.cs index 3ce1521..d552676 100644 --- a/Collections.Pooled.Benchmarks/PooledList/List.ToArray.cs +++ b/Collections.Pooled.Benchmarks/PooledList/List.ToArray.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledList { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class List_ToArray : ListBase { diff --git a/Collections.Pooled.Benchmarks/PooledList/ListBase.cs b/Collections.Pooled.Benchmarks/PooledList/ListBase.cs index c47fed2..bb517c8 100644 --- a/Collections.Pooled.Benchmarks/PooledList/ListBase.cs +++ b/Collections.Pooled.Benchmarks/PooledList/ListBase.cs @@ -1,6 +1,5 @@ -using System; +using System; using System.Collections.Generic; -using System.Text; namespace Collections.Pooled.Benchmarks.PooledList { diff --git a/Collections.Pooled.Benchmarks/PooledQueue/Queue.Constructors.cs b/Collections.Pooled.Benchmarks/PooledQueue/Queue.Constructors.cs index 04ded2f..87d083b 100644 --- a/Collections.Pooled.Benchmarks/PooledQueue/Queue.Constructors.cs +++ b/Collections.Pooled.Benchmarks/PooledQueue/Queue.Constructors.cs @@ -1,18 +1,17 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledQueue { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Queue_Constructors : QueueBase { - [Benchmark(Baseline=true)] + [Benchmark(Baseline = true)] public void QueueICollectionConstructor() { if (Type == QueueType.Int) @@ -102,7 +101,7 @@ public void PooledIEnumerableConstructor() private IEnumerable IntEnumerable() { - for (int i=0; i < N; i++) + for (int i = 0; i < N; i++) yield return intArray[i]; } diff --git a/Collections.Pooled.Benchmarks/PooledQueue/Queue.Dequeue.cs b/Collections.Pooled.Benchmarks/PooledQueue/Queue.Dequeue.cs index 252e3de..9596b09 100644 --- a/Collections.Pooled.Benchmarks/PooledQueue/Queue.Dequeue.cs +++ b/Collections.Pooled.Benchmarks/PooledQueue/Queue.Dequeue.cs @@ -1,14 +1,14 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledQueue { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Queue_Dequeue : QueueBase { diff --git a/Collections.Pooled.Benchmarks/PooledQueue/Queue.Enqueue.cs b/Collections.Pooled.Benchmarks/PooledQueue/Queue.Enqueue.cs index de45fbd..45b5750 100644 --- a/Collections.Pooled.Benchmarks/PooledQueue/Queue.Enqueue.cs +++ b/Collections.Pooled.Benchmarks/PooledQueue/Queue.Enqueue.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledQueue { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Queue_Enqueue : QueueBase { diff --git a/Collections.Pooled.Benchmarks/PooledQueue/Queue.Peek.cs b/Collections.Pooled.Benchmarks/PooledQueue/Queue.Peek.cs index 49711d0..dfe9e2d 100644 --- a/Collections.Pooled.Benchmarks/PooledQueue/Queue.Peek.cs +++ b/Collections.Pooled.Benchmarks/PooledQueue/Queue.Peek.cs @@ -1,14 +1,14 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledQueue { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Queue_Peek : QueueBase { diff --git a/Collections.Pooled.Benchmarks/PooledQueue/Queue.TryDequeue.cs b/Collections.Pooled.Benchmarks/PooledQueue/Queue.TryDequeue.cs index 9d4192f..bfd0f8e 100644 --- a/Collections.Pooled.Benchmarks/PooledQueue/Queue.TryDequeue.cs +++ b/Collections.Pooled.Benchmarks/PooledQueue/Queue.TryDequeue.cs @@ -1,14 +1,14 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using System; +using System.Collections.Generic; +using BenchmarkDotNet.Jobs; namespace Collections.Pooled.Benchmarks.PooledQueue { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Queue_TryDequeue : QueueBase { diff --git a/Collections.Pooled.Benchmarks/PooledQueue/Queue.TryPeek.cs b/Collections.Pooled.Benchmarks/PooledQueue/Queue.TryPeek.cs index 2b25c9d..5a6d33e 100644 --- a/Collections.Pooled.Benchmarks/PooledQueue/Queue.TryPeek.cs +++ b/Collections.Pooled.Benchmarks/PooledQueue/Queue.TryPeek.cs @@ -1,14 +1,14 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledQueue { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Queue_TryPeek : QueueBase { diff --git a/Collections.Pooled.Benchmarks/PooledQueue/QueueBase.cs b/Collections.Pooled.Benchmarks/PooledQueue/QueueBase.cs index 38a6eba..0d671d9 100644 --- a/Collections.Pooled.Benchmarks/PooledQueue/QueueBase.cs +++ b/Collections.Pooled.Benchmarks/PooledQueue/QueueBase.cs @@ -1,6 +1,5 @@ -using System; +using System; using System.Collections.Generic; -using System.Text; namespace Collections.Pooled.Benchmarks.PooledQueue { diff --git a/Collections.Pooled.Benchmarks/PooledQueue/QueueExtensions.cs b/Collections.Pooled.Benchmarks/PooledQueue/QueueExtensions.cs index 015cbc6..8e9b2f9 100644 --- a/Collections.Pooled.Benchmarks/PooledQueue/QueueExtensions.cs +++ b/Collections.Pooled.Benchmarks/PooledQueue/QueueExtensions.cs @@ -1,6 +1,4 @@ -using System; using System.Collections.Generic; -using System.Text; namespace Collections.Pooled.Benchmarks.PooledQueue { diff --git a/Collections.Pooled.Benchmarks/PooledSet/RandomTGenerator.cs b/Collections.Pooled.Benchmarks/PooledSet/RandomTGenerator.cs index acb083b..a881523 100644 --- a/Collections.Pooled.Benchmarks/PooledSet/RandomTGenerator.cs +++ b/Collections.Pooled.Benchmarks/PooledSet/RandomTGenerator.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Text; diff --git a/Collections.Pooled.Benchmarks/PooledSet/Set.Add.cs b/Collections.Pooled.Benchmarks/PooledSet/Set.Add.cs index 41b37d7..b00dce1 100644 --- a/Collections.Pooled.Benchmarks/PooledSet/Set.Add.cs +++ b/Collections.Pooled.Benchmarks/PooledSet/Set.Add.cs @@ -1,6 +1,6 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledSet { @@ -8,11 +8,10 @@ namespace Collections.Pooled.Benchmarks.PooledSet // prevents us from running CoreJob with a CLR host, or ClrJob with a Core host. // When this is resolved, should change all the tests to run both job types at the same time. -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Set_Add : SetBase { diff --git a/Collections.Pooled.Benchmarks/PooledSet/Set.Clear.cs b/Collections.Pooled.Benchmarks/PooledSet/Set.Clear.cs index 4ded36c..8401472 100644 --- a/Collections.Pooled.Benchmarks/PooledSet/Set.Clear.cs +++ b/Collections.Pooled.Benchmarks/PooledSet/Set.Clear.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledSet { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Set_Clear : SetBase { diff --git a/Collections.Pooled.Benchmarks/PooledSet/Set.Contains_False.cs b/Collections.Pooled.Benchmarks/PooledSet/Set.Contains_False.cs index 3d70e31..530164a 100644 --- a/Collections.Pooled.Benchmarks/PooledSet/Set.Contains_False.cs +++ b/Collections.Pooled.Benchmarks/PooledSet/Set.Contains_False.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledSet { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Set_Contains_False : SetBase { diff --git a/Collections.Pooled.Benchmarks/PooledSet/Set.Contains_True.cs b/Collections.Pooled.Benchmarks/PooledSet/Set.Contains_True.cs index 93de1d2..5d8d55c 100644 --- a/Collections.Pooled.Benchmarks/PooledSet/Set.Contains_True.cs +++ b/Collections.Pooled.Benchmarks/PooledSet/Set.Contains_True.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledSet { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Set_Contains_True : SetBase { diff --git a/Collections.Pooled.Benchmarks/PooledSet/Set.Except.cs b/Collections.Pooled.Benchmarks/PooledSet/Set.Except.cs index 6d4bfc5..4c52659 100644 --- a/Collections.Pooled.Benchmarks/PooledSet/Set.Except.cs +++ b/Collections.Pooled.Benchmarks/PooledSet/Set.Except.cs @@ -1,13 +1,13 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledSet { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Set_Except : SetBase { diff --git a/Collections.Pooled.Benchmarks/PooledSet/Set.Intersect.cs b/Collections.Pooled.Benchmarks/PooledSet/Set.Intersect.cs index dadc6a8..2f5f13c 100644 --- a/Collections.Pooled.Benchmarks/PooledSet/Set.Intersect.cs +++ b/Collections.Pooled.Benchmarks/PooledSet/Set.Intersect.cs @@ -1,13 +1,13 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledSet { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Set_Intersect : SetBase { diff --git a/Collections.Pooled.Benchmarks/PooledSet/Set.IsProperSubset.cs b/Collections.Pooled.Benchmarks/PooledSet/Set.IsProperSubset.cs index 8416a41..fd0497c 100644 --- a/Collections.Pooled.Benchmarks/PooledSet/Set.IsProperSubset.cs +++ b/Collections.Pooled.Benchmarks/PooledSet/Set.IsProperSubset.cs @@ -1,14 +1,13 @@ -using BenchmarkDotNet.Attributes; -using System; +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledSet { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Set_IsProperSubset : SetBase { diff --git a/Collections.Pooled.Benchmarks/PooledSet/Set.IsProperSuperset.cs b/Collections.Pooled.Benchmarks/PooledSet/Set.IsProperSuperset.cs index d8f75cb..1f9a440 100644 --- a/Collections.Pooled.Benchmarks/PooledSet/Set.IsProperSuperset.cs +++ b/Collections.Pooled.Benchmarks/PooledSet/Set.IsProperSuperset.cs @@ -1,13 +1,13 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledSet { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Set_IsProperSuperset : SetBase { diff --git a/Collections.Pooled.Benchmarks/PooledSet/Set.IsSubset.cs b/Collections.Pooled.Benchmarks/PooledSet/Set.IsSubset.cs index b566a73..26b8566 100644 --- a/Collections.Pooled.Benchmarks/PooledSet/Set.IsSubset.cs +++ b/Collections.Pooled.Benchmarks/PooledSet/Set.IsSubset.cs @@ -1,13 +1,13 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledSet { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Set_IsSubset : SetBase { diff --git a/Collections.Pooled.Benchmarks/PooledSet/Set.IsSuperset.cs b/Collections.Pooled.Benchmarks/PooledSet/Set.IsSuperset.cs index b337a4d..c60ba8c 100644 --- a/Collections.Pooled.Benchmarks/PooledSet/Set.IsSuperset.cs +++ b/Collections.Pooled.Benchmarks/PooledSet/Set.IsSuperset.cs @@ -1,13 +1,13 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledSet { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Set_IsSuperset : SetBase { diff --git a/Collections.Pooled.Benchmarks/PooledSet/Set.Remove.cs b/Collections.Pooled.Benchmarks/PooledSet/Set.Remove.cs index 3a3306c..588527d 100644 --- a/Collections.Pooled.Benchmarks/PooledSet/Set.Remove.cs +++ b/Collections.Pooled.Benchmarks/PooledSet/Set.Remove.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledSet { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Set_Remove : SetBase { diff --git a/Collections.Pooled.Benchmarks/PooledSet/Set.SymmetricExcept.cs b/Collections.Pooled.Benchmarks/PooledSet/Set.SymmetricExcept.cs index 194e25e..5422090 100644 --- a/Collections.Pooled.Benchmarks/PooledSet/Set.SymmetricExcept.cs +++ b/Collections.Pooled.Benchmarks/PooledSet/Set.SymmetricExcept.cs @@ -1,13 +1,13 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledSet { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Set_SymmetricExcept : SetBase { diff --git a/Collections.Pooled.Benchmarks/PooledSet/Set.Union.cs b/Collections.Pooled.Benchmarks/PooledSet/Set.Union.cs index 86609ad..f663d40 100644 --- a/Collections.Pooled.Benchmarks/PooledSet/Set.Union.cs +++ b/Collections.Pooled.Benchmarks/PooledSet/Set.Union.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledSet { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Set_Union : SetBase { diff --git a/Collections.Pooled.Benchmarks/PooledSet/Set.Union_NoOp.cs b/Collections.Pooled.Benchmarks/PooledSet/Set.Union_NoOp.cs index a9b8a6e..43072a4 100644 --- a/Collections.Pooled.Benchmarks/PooledSet/Set.Union_NoOp.cs +++ b/Collections.Pooled.Benchmarks/PooledSet/Set.Union_NoOp.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledSet { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Set_Union_NoOp : SetBase { diff --git a/Collections.Pooled.Benchmarks/PooledSet/SetBase.cs b/Collections.Pooled.Benchmarks/PooledSet/SetBase.cs index f019474..e934df9 100644 --- a/Collections.Pooled.Benchmarks/PooledSet/SetBase.cs +++ b/Collections.Pooled.Benchmarks/PooledSet/SetBase.cs @@ -1,6 +1,5 @@ -using System; +using System; using System.Collections.Generic; -using System.Text; namespace Collections.Pooled.Benchmarks.PooledSet { diff --git a/Collections.Pooled.Benchmarks/PooledStack/Stack.Constructors.cs b/Collections.Pooled.Benchmarks/PooledStack/Stack.Constructors.cs index d9e1172..3e0e522 100644 --- a/Collections.Pooled.Benchmarks/PooledStack/Stack.Constructors.cs +++ b/Collections.Pooled.Benchmarks/PooledStack/Stack.Constructors.cs @@ -1,18 +1,17 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledStack { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Stack_Constructors : StackBase { - [Benchmark(Baseline=true)] + [Benchmark(Baseline = true)] public void StackICollectionConstructor() { if (Type == StackType.Int) @@ -102,7 +101,7 @@ public void PooledIEnumerableConstructor() private IEnumerable IntEnumerable() { - for (int i=0; i < N; i++) + for (int i = 0; i < N; i++) yield return intArray[i]; } diff --git a/Collections.Pooled.Benchmarks/PooledStack/Stack.Peek.cs b/Collections.Pooled.Benchmarks/PooledStack/Stack.Peek.cs index 5e5629b..c565ed5 100644 --- a/Collections.Pooled.Benchmarks/PooledStack/Stack.Peek.cs +++ b/Collections.Pooled.Benchmarks/PooledStack/Stack.Peek.cs @@ -1,14 +1,14 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledStack { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Stack_Peek : StackBase { diff --git a/Collections.Pooled.Benchmarks/PooledStack/Stack.Pop.cs b/Collections.Pooled.Benchmarks/PooledStack/Stack.Pop.cs index 8c2e8eb..f196c16 100644 --- a/Collections.Pooled.Benchmarks/PooledStack/Stack.Pop.cs +++ b/Collections.Pooled.Benchmarks/PooledStack/Stack.Pop.cs @@ -1,14 +1,14 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledStack { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Stack_Pop : StackBase { diff --git a/Collections.Pooled.Benchmarks/PooledStack/Stack.Push.cs b/Collections.Pooled.Benchmarks/PooledStack/Stack.Push.cs index 1813e4d..cb65a99 100644 --- a/Collections.Pooled.Benchmarks/PooledStack/Stack.Push.cs +++ b/Collections.Pooled.Benchmarks/PooledStack/Stack.Push.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledStack { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Stack_Push : StackBase { diff --git a/Collections.Pooled.Benchmarks/PooledStack/Stack.TryPeek.cs b/Collections.Pooled.Benchmarks/PooledStack/Stack.TryPeek.cs index 57d7b31..4228a0e 100644 --- a/Collections.Pooled.Benchmarks/PooledStack/Stack.TryPeek.cs +++ b/Collections.Pooled.Benchmarks/PooledStack/Stack.TryPeek.cs @@ -1,14 +1,14 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledStack { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Stack_TryPeek : StackBase { diff --git a/Collections.Pooled.Benchmarks/PooledStack/Stack.TryPop.cs b/Collections.Pooled.Benchmarks/PooledStack/Stack.TryPop.cs index 779c380..1f32789 100644 --- a/Collections.Pooled.Benchmarks/PooledStack/Stack.TryPop.cs +++ b/Collections.Pooled.Benchmarks/PooledStack/Stack.TryPop.cs @@ -1,14 +1,14 @@ -using System; -using System.Collections.Generic; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Jobs; +using System; +using System.Collections.Generic; namespace Collections.Pooled.Benchmarks.PooledStack { -#if NETCOREAPP2_2 - [CoreJob] -#elif NET472 - [ClrJob] -#endif + [SimpleJob(RuntimeMoniker.Net472)] + [SimpleJob(RuntimeMoniker.Net60)] + [SimpleJob(RuntimeMoniker.Net70)] + [SimpleJob(RuntimeMoniker.Net80)] [MemoryDiagnoser] public class Stack_TryPop : StackBase { diff --git a/Collections.Pooled.Benchmarks/PooledStack/StackBase.cs b/Collections.Pooled.Benchmarks/PooledStack/StackBase.cs index 8fe1d73..f4b5fb0 100644 --- a/Collections.Pooled.Benchmarks/PooledStack/StackBase.cs +++ b/Collections.Pooled.Benchmarks/PooledStack/StackBase.cs @@ -1,6 +1,5 @@ -using System; +using System; using System.Collections.Generic; -using System.Text; namespace Collections.Pooled.Benchmarks.PooledStack { diff --git a/Collections.Pooled.Benchmarks/PooledStack/StackExtensions.cs b/Collections.Pooled.Benchmarks/PooledStack/StackExtensions.cs index a3c4beb..1db4395 100644 --- a/Collections.Pooled.Benchmarks/PooledStack/StackExtensions.cs +++ b/Collections.Pooled.Benchmarks/PooledStack/StackExtensions.cs @@ -1,6 +1,4 @@ -using System; using System.Collections.Generic; -using System.Text; namespace Collections.Pooled.Benchmarks.PooledStack { diff --git a/Collections.Pooled.Benchmarks/Program.cs b/Collections.Pooled.Benchmarks/Program.cs index de8d529..67dc36c 100644 --- a/Collections.Pooled.Benchmarks/Program.cs +++ b/Collections.Pooled.Benchmarks/Program.cs @@ -1,4 +1,4 @@ -using BenchmarkDotNet.Running; +using BenchmarkDotNet.Running; /* Powershell commands to shorten the benchmark output filenames: Get-ChildItem | Rename-Item -NewName {$_.name -replace 'Collections.Pooled.Benchmarks.PooledList.','' } diff --git a/Collections.Pooled.Tests/Collections.Pooled.Tests.csproj b/Collections.Pooled.Tests/Collections.Pooled.Tests.csproj index bf8af02..61e5e1e 100644 --- a/Collections.Pooled.Tests/Collections.Pooled.Tests.csproj +++ b/Collections.Pooled.Tests/Collections.Pooled.Tests.csproj @@ -1,9 +1,10 @@  - netcoreapp2.2 - 7.3 + net6.0;net7.0;net8.0 + 10.0 false + true diff --git a/Collections.Pooled.Tests/IEnumerable.Generic.Tests.cs b/Collections.Pooled.Tests/IEnumerable.Generic.Tests.cs index 68540a2..0eeb4ac 100644 --- a/Collections.Pooled.Tests/IEnumerable.Generic.Tests.cs +++ b/Collections.Pooled.Tests/IEnumerable.Generic.Tests.cs @@ -10,6 +10,10 @@ using System.Runtime.Serialization.Formatters.Binary; using Xunit; +#if NET8_0_OR_GREATER +using System.Collections.ObjectModel; +#endif + namespace Collections.Pooled.Tests { /// @@ -591,6 +595,26 @@ public void IEnumerable_Generic_Enumerator_Current_ReturnsSameObjectsOnDifferent Assert.Equal(firstValues[key], secondValues[key]); } + // .NET 8.0 introduced a change in the enumerator returned from a ReadOnlyCollection when + // the underling list is empty. Now it returns SZGenericArrayEnumerator which will throw an + // InvalidOperattionException when accessing current before enumeration starts and after it has completed + // https://source.dot.net/System.Private.CoreLib/R/f7a38d1d13a03244.html +#if NET8_0_OR_GREATER + [Theory] + [MemberData(nameof(ValidCollectionSizes))] + public void IEnumerable_Generic_Enumerator_Current_BeforeFirstMoveNext_UndefinedBehavior(int count) + { + T current; + IEnumerable enumerable = GenericIEnumerableFactory(count); + using (IEnumerator enumerator = enumerable.GetEnumerator()) + { + if (Enumerator_Current_UndefinedOperation_Throws || (count == 0 && enumerable is ReadOnlyCollection)) + Assert.Throws(() => enumerator.Current); + else + current = enumerator.Current; + } + } +#else [Theory] [MemberData(nameof(ValidCollectionSizes))] public void IEnumerable_Generic_Enumerator_Current_BeforeFirstMoveNext_UndefinedBehavior(int count) @@ -605,7 +629,29 @@ public void IEnumerable_Generic_Enumerator_Current_BeforeFirstMoveNext_Undefined current = enumerator.Current; } } +#endif + // .NET 8.0 introduced a change in the enumerator returned from a ReadOnlyCollection when + // the underling list is empty. Now it returns SZGenericArrayEnumerator which will throw an + // InvalidOperattionException when accessing current before enumeration starts and after it has completed + // https://source.dot.net/System.Private.CoreLib/R/f7a38d1d13a03244.html +#if NET8_0_OR_GREATER + [Theory] + [MemberData(nameof(ValidCollectionSizes))] + public void IEnumerable_Generic_Enumerator_Current_AfterEndOfEnumerable_UndefinedBehavior(int count) + { + T current; + IEnumerable enumerable = GenericIEnumerableFactory(count); + using (IEnumerator enumerator = enumerable.GetEnumerator()) + { + while (enumerator.MoveNext()) ; + if (Enumerator_Current_UndefinedOperation_Throws || (count == 0 && enumerable is ReadOnlyCollection)) + Assert.Throws(() => enumerator.Current); + else + current = enumerator.Current; + } + } +#else [Theory] [MemberData(nameof(ValidCollectionSizes))] public void IEnumerable_Generic_Enumerator_Current_AfterEndOfEnumerable_UndefinedBehavior(int count) @@ -621,6 +667,7 @@ public void IEnumerable_Generic_Enumerator_Current_AfterEndOfEnumerable_Undefine current = enumerator.Current; } } +#endif [Theory] [MemberData(nameof(ValidCollectionSizes))] @@ -903,6 +950,7 @@ public void IEnumerable_Generic_Enumerator_Reset() #region Serialize +#pragma warning disable SYSLIB0011 // BinaryFormatter is deprecated and should not be used [Theory] [MemberData(nameof(ValidCollectionSizes))] public void IEnumerable_Generic_Serialize_Deserialize(int count) @@ -935,6 +983,7 @@ public void IEnumerable_Generic_Serialize_Deserialize(int count) } } } +#pragma warning restore SYSLIB0011 #endregion } diff --git a/Collections.Pooled/Collections.Pooled.csproj b/Collections.Pooled/Collections.Pooled.csproj index ec23a73..49e69bd 100644 --- a/Collections.Pooled/Collections.Pooled.csproj +++ b/Collections.Pooled/Collections.Pooled.csproj @@ -1,7 +1,7 @@ - netstandard2.0;netcoreapp2.1 + netstandard2.0;net6.0;net7.0;net8.0 7.3 true Joel Mueller