File tree Expand file tree Collapse file tree
src/test/java/de/tilman_neumann/jml/primes/exact Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments