We'll now clear the dictionary after renting, to avoid unnecessary clearing if it's not going to be used anymore.
This commit is contained in:
1 parent
50d66a5186
commit
d381abe0cc
1 file changed
+1
-2
@@ -1069,7 +1069,7 @@ internal static partial class PrimeOrderCalculator
|
|||||||
// exponentSlots.Clear();
|
// exponentSlots.Clear();
|
||||||
|
|
||||||
counts = ThreadStaticPools.RentUlongIntDictionary(Math.Max(FactorSlotCount, 8));
|
counts = ThreadStaticPools.RentUlongIntDictionary(Math.Max(FactorSlotCount, 8));
|
||||||
// counts.Clear();
|
counts.Clear();
|
||||||
|
|
||||||
// bool gpuPopulated = TryPopulateSmallPrimeFactorsGpu(value, limit, primeSlots, exponentSlots, out factorCount, out remaining);
|
// bool gpuPopulated = TryPopulateSmallPrimeFactorsGpu(value, limit, primeSlots, exponentSlots, out factorCount, out remaining);
|
||||||
// if (!gpuPopulated)
|
// if (!gpuPopulated)
|
||||||
@@ -1091,7 +1091,6 @@ internal static partial class PrimeOrderCalculator
|
|||||||
}
|
}
|
||||||
|
|
||||||
factorCount = copyIndex;
|
factorCount = copyIndex;
|
||||||
counts.Clear();
|
|
||||||
ThreadStaticPools.ReturnUlongIntDictionary(counts);
|
ThreadStaticPools.ReturnUlongIntDictionary(counts);
|
||||||
counts = null;
|
counts = null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user