ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/loops/NavigableMapCheck.java
(Generate patch)

Comparing jsr166/src/test/loops/NavigableMapCheck.java (file contents):
Revision 1.13 by jsr166, Wed Dec 31 17:00:58 2014 UTC vs.
Revision 1.15 by jsr166, Mon Aug 10 03:13:33 2015 UTC

# Line 37 | Line 37 | public class NavigableMapCheck {
37              }
38          }
39  
40
40          if (args.length > 1)
41              numTests = Integer.parseInt(args[1]);
42  
# Line 46 | Line 45 | public class NavigableMapCheck {
45  
46          System.out.println("Testing " + mapClass.getName() + " trials: " + numTests + " size: " + size);
47  
49
48          absentSize = 8;
49          while (absentSize < size) absentSize <<= 1;
50          absentMask = absentSize - 1;
# Line 59 | Line 57 | public class NavigableMapCheck {
57          for (int i = 0; i < size; ++i)
58              key[i] = new Integer(i * 2 + 1);
59  
62
60          for (int rep = 0; rep < numTests; ++rep) {
61              runTest(newMap(mapClass), key);
62          }
63  
64          TestTimer.printStats();
68
65      }
66  
67      static NavigableMap newMap(Class<?> cl) {
# Line 77 | Line 73 | public class NavigableMapCheck {
73          }
74      }
75  
80
76      static void runTest(NavigableMap s, Integer[] key) {
77          shuffle(key);
78          int size = key.length;
# Line 171 | Line 166 | public class NavigableMapCheck {
166          reallyAssert(sum == expect);
167      }
168  
174
169      static void t9(NavigableMap s) {
170          int sum = 0;
171          int iters = 20;
# Line 237 | Line 231 | public class NavigableMapCheck {
231          reallyAssert(sum == iters-1);
232      }
233  
240
234      static void ktest(NavigableMap s, int size, Integer[] key) {
235          timer.start("ContainsKey            ", size);
236          Set ks = s.keySet();
# Line 249 | Line 242 | public class NavigableMapCheck {
242          reallyAssert(sum == size);
243      }
244  
252
245      static void ittest1(NavigableMap s, int size) {
246          int sum = 0;
247          timer.start("Iter Key               ", size);
# Line 299 | Line 291 | public class NavigableMapCheck {
291          reallyAssert(sum == size);
292      }
293  
302
294      static void rittest(NavigableMap s, int size) {
295          rittest1(s, size);
296          //        rittest2(s, size);
297      }
298  
308
299      static void rtest(NavigableMap s, int size) {
300          timer.start("Remove (iterator)      ", size);
301          for (Iterator it = s.keySet().iterator(); it.hasNext(); ) {
# Line 324 | Line 314 | public class NavigableMapCheck {
314          timer.finish();
315      }
316  
327
317      static void dtest(NavigableMap s, int size, Integer[] key) {
318          timer.start("Put (putAll)           ", size * 2);
319          NavigableMap s2 = null;
# Line 391 | Line 380 | public class NavigableMapCheck {
380          reallyAssert(s2.isEmpty() && s.isEmpty());
381      }
382  
394
395
383      static void test(NavigableMap s, Integer[] key) {
384          int size = key.length;
385  
# Line 454 | Line 441 | public class NavigableMapCheck {
441              startTime = System.currentTimeMillis();
442          }
443  
457
444          String classify() {
445              if (name.startsWith("Get"))
446                  return "Get                    ";
# Line 494 | Line 480 | public class NavigableMapCheck {
480                      if (timePerOp < stats.least) stats.least = timePerOp;
481                  }
482              }
497
483          }
499
484      }
485  
486      static class Stats {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines