@@ -28,8 +28,7 @@ public class Uint128PerformanceTest {
2828 private static void testPerformance () {
2929 // Performance tests are carried out in double loops over the same numbers.
3030 // Otherwise number creation is much more expensive than testing the operations themselves.
31- int NCOUNT = 100000000 ;
32- int NCOUNT2 = 100000 ; // used for add operations which are more expensive
31+ int NCOUNT = 300000 ;
3332
3433 // set up test numbers
3534 long [] a_arr = new long [NCOUNT ];
@@ -42,24 +41,22 @@ private static void testPerformance() {
4241
4342 // test performance of add implementations
4443 long t0 = System .currentTimeMillis ();
45- for (int i =0 ; i <NCOUNT2 ; i ++) {
46- for (int j =0 ; j <NCOUNT2 ; j ++) {
44+ for (int i =0 ; i <NCOUNT ; i ++) {
45+ for (int j =0 ; j <NCOUNT ; j ++) {
4746 a128_arr [i ].add_v1 (a128_arr [j ]);
4847 }
4948 }
5049 long t1 = System .currentTimeMillis ();
5150 LOG .info ("add_v1 took " + (t1 -t0 ) + "ms" );
5251
5352 t0 = System .currentTimeMillis ();
54- for (int i =0 ; i <NCOUNT2 ; i ++) {
55- for (int j =0 ; j <NCOUNT2 ; j ++) {
53+ for (int i =0 ; i <NCOUNT ; i ++) {
54+ for (int j =0 ; j <NCOUNT ; j ++) {
5655 a128_arr [i ].add /*_v2*/ (a128_arr [j ]);
5756 }
5857 }
5958 t1 = System .currentTimeMillis ();
6059 LOG .info ("add_v2 took " + (t1 -t0 ) + "ms" );
61- // The results of this comparison seem to be misleading. If we compare the two implementations
62- // in different PollardRhoBrentMontgomery63 variants than v2 is much faster...
6360
6461 // test performance of mul64 implementations
6562 t0 = System .currentTimeMillis ();
0 commit comments