Benchmarks reworked to save time on test data creation & have more comparable results against baseline.
This commit is contained in:
1 parent
73d3e32107
commit
bb878caa39
35 files changed
+586
-418
No files matched your search
@@ -1,39 +1,33 @@
|
||||
using BenchmarkDotNet.Attributes;
|
||||
using Collections.Pooled;
|
||||
using Collections.Pooled;
|
||||
|
||||
namespace Recyclable.Collections.Benchmarks
|
||||
{
|
||||
public partial class RecyclableCollectionsBenchmarks
|
||||
{
|
||||
//[Benchmark(Baseline = false)]
|
||||
public void Array_Create_WithCapacity()
|
||||
{
|
||||
var data = new long[TestObjectCount];
|
||||
DoNothing(data);
|
||||
}
|
||||
|
||||
//[Benchmark(Baseline = false)]
|
||||
public void List_Create_WithCapacity()
|
||||
{
|
||||
var list = new List<long>(TestObjectCount);
|
||||
DoNothing(list);
|
||||
}
|
||||
|
||||
//[Benchmark(Baseline = true)]
|
||||
public void PooledList_Create_WithCapacity()
|
||||
{
|
||||
using var list = new PooledList<long>(capacity: TestObjectCount, ClearMode.Auto);
|
||||
DoNothing(list);
|
||||
}
|
||||
|
||||
//[Benchmark(Baseline = false)]
|
||||
public void RecyclableArrayList_Create_WithCapacity()
|
||||
{
|
||||
using var list = new RecyclableArrayList<long>(TestObjectCount);
|
||||
DoNothing(list);
|
||||
}
|
||||
|
||||
//[Benchmark(Baseline = false)]
|
||||
public void RecyclableList_Create_WithCapacity()
|
||||
{
|
||||
using var list = new RecyclableList<long>(minBlockSize: BlockSize, expectedItemsCount: TestObjectCount);
|
||||
|
||||
Reference in new issue
Block a user