RecyclableArrayList.AddRange added. Smaller perf improvements.
This commit is contained in:
1 parent
880abd605e
commit
012fc3b21f
8 files changed
+134
-25
No files matched your search
@@ -6,28 +6,28 @@ namespace Recyclable.Collections.Benchmarks
|
||||
{
|
||||
private readonly List<object> _testList;
|
||||
|
||||
[Benchmark(Baseline = true)]
|
||||
//[Benchmark(Baseline = true)]
|
||||
public void List_Create()
|
||||
{
|
||||
var list = new List<object>();
|
||||
DoNothing(list);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
//[Benchmark]
|
||||
public void List_Create_0Capacity()
|
||||
{
|
||||
var list = new List<object>(0);
|
||||
DoNothing(list);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
//[Benchmark]
|
||||
public void List_Create_WithCapacity()
|
||||
{
|
||||
var list = new List<object>(TestObjectCount);
|
||||
DoNothing(list);
|
||||
}
|
||||
|
||||
//[Benchmark]
|
||||
[Benchmark]
|
||||
public void List_Add()
|
||||
{
|
||||
var data = TestObjects;
|
||||
@@ -39,7 +39,7 @@ namespace Recyclable.Collections.Benchmarks
|
||||
}
|
||||
}
|
||||
|
||||
//[Benchmark]
|
||||
[Benchmark(Baseline = true)]
|
||||
public void List_Add_WithCapacity()
|
||||
{
|
||||
var data = TestObjects;
|
||||
@@ -51,6 +51,23 @@ namespace Recyclable.Collections.Benchmarks
|
||||
}
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
public void List_AddRange()
|
||||
{
|
||||
var data = TestObjects;
|
||||
var list = new List<object>();
|
||||
list.AddRange(data);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
public void List_AddRange_WithCapacity()
|
||||
{
|
||||
var data = TestObjects;
|
||||
var dataCount = TestObjectCount;
|
||||
var list = new List<object>(dataCount);
|
||||
list.AddRange(data);
|
||||
}
|
||||
|
||||
//[Benchmark]
|
||||
public void List_GetItem()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user