Small cleanup. RecyclableCollectionsBenchmarks properties & fields moved to RecyclableCollectionsBenchmark.cs file.
This commit is contained in:
1 parent
6ef79d2203
commit
b3380b1f35
7 files changed
+46
-43
No files matched your search
@@ -0,0 +1,40 @@
|
||||
using BenchmarkDotNet.Attributes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Recyclable.Collections.Benchmarks
|
||||
{
|
||||
public partial class RecyclableCollectionsBenchmarks
|
||||
{
|
||||
private object[] _testArray;
|
||||
private RecyclableArrayList<object> _testRecyclableArrayList;
|
||||
private RecyclableList<object> _testRecyclableList;
|
||||
|
||||
[GlobalSetup]
|
||||
public void Setup()
|
||||
{
|
||||
Console.WriteLine("******* GLOBAL SETUP RAISED *******");
|
||||
_testObjects = Enumerable.Range(1, TestObjectCount).Select(x => new object()).ToArray();
|
||||
_testRecyclableArrayList = new(TestObjects, TestObjectCount);
|
||||
_testRecyclableList = new(TestObjects, TestObjectCount);
|
||||
_testArray = TestObjects.ToArray();
|
||||
_testObjectsAsList = TestObjects.ToList();
|
||||
_testObjectsAsRecyclableArrayList = TestObjects.ToRecyclableArrayList();
|
||||
}
|
||||
|
||||
[GlobalCleanup]
|
||||
public void Cleanup()
|
||||
{
|
||||
Console.WriteLine("******* GLOBAL CLEANUP *******");
|
||||
_testRecyclableArrayList?.Dispose();
|
||||
_testRecyclableList?.Dispose();
|
||||
TestObjectsAsRecyclableArrayList?.Dispose();
|
||||
_testObjectsAsRecyclableArrayList = default;
|
||||
_testObjectsAsList = default;
|
||||
_testObjects = default;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user