Create benchmarks updated. Global benchmark setup & cleanup added.

This commit is contained in:
mlemanczyk committed 2023-01-16 22:00:45 +01:00
1 parent 4bfb40007a
commit cc364c5fd7
7 files changed
+38 -24

No files matched your search

+5
View File
@@ -70,6 +70,11 @@ namespace Recyclable.Collections
private static RecyclableArrayList<T[]> SetupMemoryBlocks(RecyclableList<T> owner, int blockSize, long? totalItemsCount)
{
if (blockSize <= 0)
{
return new();
}
totalItemsCount ??= 8 * blockSize;
int additionalArray = totalItemsCount % blockSize > 0 ? 1 : 0;
int memoryBlockCount = (int)(totalItemsCount.Value / blockSize).LimitTo(int.MaxValue) + additionalArray;