Skip to content

Commit 5b10cfb

Browse files
committed
comments
1 parent a44067f commit 5b10cfb

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/test/java/de/tilman_neumann/jml/primes/exact/TDivPrimeTestPerformanceTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public class TDivPrimeTestPerformanceTest {
1616
private static final LemirePrimeTest LEMIRE_TEST = LemirePrimeTest.getInstance();
1717
private static final Random RNG = new Random();
1818

19+
// here we need random test numbers, otherwise the compiler would over-optimize the tests
1920
private static final int[] TEST_NUMBERS = setupTestNumbers();
2021

2122
private static int[] setupTestNumbers() {
@@ -68,14 +69,14 @@ private static void test() {
6869
LEMIRE_TEST.isPrime_v2(n);
6970
}
7071
t1 = System.nanoTime();
71-
LOG.info("LEMIRE_TEST.isPrime_v2 took " + (t1-t0) + " ns"); // best so far!
72+
LOG.info("LEMIRE_TEST.isPrime_v2 took " + (t1-t0) + " ns");
7273

7374
t0 = System.nanoTime();
7475
for (int n : TEST_NUMBERS) {
7576
LEMIRE_TEST.isPrime/*Unrolled*/(n);
7677
}
7778
t1 = System.nanoTime();
78-
LOG.info("LEMIRE_TEST.isPrimeUnrolled took " + (t1-t0) + " ns");
79+
LOG.info("LEMIRE_TEST.isPrimeUnrolled took " + (t1-t0) + " ns"); // champion
7980
}
8081

8182
public static void main(String[] args) {

0 commit comments

Comments
 (0)