Various small optimizations and cleanups. Methods made static, where possible. Duplicated & slow PrimeTester.BinaryGcd implementation removed. Optimized version was used instead.
This commit is contained in:
1 parent
9939c5d562
commit
df04ba601c
4 files changed
+43
-105
No files matched your search
@@ -28,8 +28,8 @@ public class PrimeTesterBenchmarks
|
||||
|
||||
PrimeOrderCalculatorAccelerator.WarmUp();
|
||||
// HeuristicGroupABPrimeTesterAccelerator.WarmUp();
|
||||
_ = _heuristicTester.IsPrimeCpu(_candidates[0]);
|
||||
_ = _heuristicTester.IsPrimeGpu(_candidates[0]);
|
||||
_ = HeuristicPrimeTester.IsPrimeCpu(_candidates[0]);
|
||||
_ = HeuristicPrimeTester.IsPrimeGpu(_candidates[0]);
|
||||
_ = Prime.Numbers.IsPrime(_candidates[0]);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class PrimeTesterBenchmarks
|
||||
|
||||
for (int i = 0; i < values.Length; i++)
|
||||
{
|
||||
if (tester.IsPrimeCpu(values[i]))
|
||||
if (HeuristicPrimeTester.IsPrimeCpu(values[i]))
|
||||
{
|
||||
primeCount++;
|
||||
}
|
||||
@@ -60,7 +60,7 @@ public class PrimeTesterBenchmarks
|
||||
|
||||
for (int i = 0; i < values.Length; i++)
|
||||
{
|
||||
if (tester.IsPrimeGpu(values[i]))
|
||||
if (HeuristicPrimeTester.IsPrimeGpu(values[i]))
|
||||
{
|
||||
primeCount++;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user