@@ -43,15 +43,18 @@ public class RngPerformanceTest {
4343 private static final long LOWER_LONG = 1L <<20 ;
4444 private static final long UPPER_LONG = 1L <<50 ;
4545
46+ // any-size generators
4647 private static final SecureRandom secureRandom = new SecureRandom ();
4748 private static final Random random = new Random ();
4849 private static final Rng rng = new Rng ();
50+
51+ // pure int generators
4952 private static final SpRand32 spRand32 = new SpRand32 ();
5053 private static final Xorshf32 xorshf32 = new Xorshf32 ();
51- private static final Xorshf32b xorshf32b = new Xorshf32b ();
54+
55+ // pure long generators
5256 private static final LehmerRng64 lehmer64 = new LehmerRng64 ();
5357 private static final LehmerRng64MH lehmer64MH = new LehmerRng64MH ();
54- private static final Xorshf64 xorshf64 = new Xorshf64 ();
5558 private static final SplitMix64 splitMix64 = new SplitMix64 ();
5659 private static final Xorshift64Star xorshift64Star = new Xorshift64Star ();
5760 private static final Xorshift128Plus xorshift128Plus = new Xorshift128Plus ();
@@ -82,10 +85,6 @@ private static void testNextInt() {
8285 xorshf32 .nextInt ();
8386 }
8487 LOG .debug ("Xorshf32.nextInt() took " + timer .capture () + " ms" );
85- for (int i =0 ; i <NCOUNT ; i ++) {
86- xorshf32b .nextInt ();
87- }
88- LOG .debug ("Xorshf32b.nextInt() took " + timer .capture () + " ms" );
8988 }
9089
9190 private static void testNextIntWithUpperBound () {
@@ -112,10 +111,6 @@ private static void testNextIntWithUpperBound() {
112111 xorshf32 .nextInt (UPPER_INT );
113112 }
114113 LOG .debug ("Xorshf32.nextInt(" + UPPER_INT + ") took " + timer .capture () + " ms" );
115- for (int i =0 ; i <NCOUNT ; i ++) {
116- xorshf32b .nextInt (UPPER_INT );
117- }
118- LOG .debug ("Xorshf32b.nextInt(" + UPPER_INT + ") took " + timer .capture () + " ms" );
119114 }
120115
121116 private static void testNextIntWithLowerUpperBound () {
@@ -144,10 +139,6 @@ private static void testNextIntWithLowerUpperBound() {
144139 xorshf32 .nextInt (LOWER_INT , UPPER_INT );
145140 }
146141 LOG .debug ("Xorshf32.nextInt(" + LOWER_INT + ", " + UPPER_INT + ") took " + timer .capture () + " ms" );
147- for (int i =0 ; i <NCOUNT ; i ++) {
148- xorshf32b .nextInt (LOWER_INT , UPPER_INT );
149- }
150- LOG .debug ("Xorshf32b.nextInt(" + LOWER_INT + ", " + UPPER_INT + ") took " + timer .capture () + " ms" );
151142 }
152143
153144 private static void testNextLong () {
@@ -174,10 +165,6 @@ private static void testNextLong() {
174165 lehmer64MH .nextLong ();
175166 }
176167 LOG .debug ("LehmerRng64MH.nextLong() took " + timer .capture () + " ms" );
177- for (int i =0 ; i <NCOUNT ; i ++) {
178- xorshf64 .nextLong ();
179- }
180- LOG .debug ("Xorshf64.nextLong() took " + timer .capture () + " ms" );
181168 for (int i =0 ; i <NCOUNT ; i ++) {
182169 splitMix64 .nextLong ();
183170 }
@@ -202,10 +189,6 @@ private static void testNextLong() {
202189
203190 private static void testNextLongWithUpperBound () {
204191 Timer timer = new Timer ();
205- for (int i =0 ; i <NCOUNT ; i ++) {
206- xorshf64 .nextLong (UPPER_LONG );
207- }
208- LOG .debug ("Xorshf64.nextLong(" + UPPER_LONG + ") took " + timer .capture () + " ms" );
209192 for (int i =0 ; i <NCOUNT ; i ++) {
210193 splitMix64 .nextLong (UPPER_LONG );
211194 }
@@ -230,10 +213,6 @@ private static void testNextLongWithUpperBound() {
230213
231214 private static void testNextLongWithLowerUpperBound () {
232215 Timer timer = new Timer ();
233- for (int i =0 ; i <NCOUNT ; i ++) {
234- xorshf64 .nextLong (LOWER_LONG , UPPER_LONG );
235- }
236- LOG .debug ("Xorshf64.nextLong(" + LOWER_LONG + ", " + UPPER_LONG + ") took " + timer .capture () + " ms" );
237216 for (int i =0 ; i <NCOUNT ; i ++) {
238217 splitMix64 .nextLong (LOWER_LONG , UPPER_LONG );
239218 }
0 commit comments