@@ -28,8 +28,7 @@ public class Uint128PerformanceTest {
28
28
private static void testPerformance () {
29
29
// Performance tests are carried out in double loops over the same numbers.
30
30
// 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 ;
33
32
34
33
// set up test numbers
35
34
long [] a_arr = new long [NCOUNT ];
@@ -42,24 +41,22 @@ private static void testPerformance() {
42
41
43
42
// test performance of add implementations
44
43
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 ++) {
47
46
a128_arr [i ].add_v1 (a128_arr [j ]);
48
47
}
49
48
}
50
49
long t1 = System .currentTimeMillis ();
51
50
LOG .info ("add_v1 took " + (t1 -t0 ) + "ms" );
52
51
53
52
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 ++) {
56
55
a128_arr [i ].add /*_v2*/ (a128_arr [j ]);
57
56
}
58
57
}
59
58
t1 = System .currentTimeMillis ();
60
59
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...
63
60
64
61
// test performance of mul64 implementations
65
62
t0 = System .currentTimeMillis ();
0 commit comments