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

Comparing jsr166/src/test/loops/MapWordLoops.java (file contents):
Revision 1.2 by dl, Mon May 9 19:33:30 2005 UTC vs.
Revision 1.3 by dl, Sun Aug 7 19:25:55 2005 UTC

# Line 13 | Line 13 | public class MapWordLoops {
13          "class.txt",
14          "dir.txt",
15          "ids.txt",
16 <        "/usr/dict/words",
16 >        //        "/usr/dict/words",
17      };
18  
19      static final int MAX_WORDS = 500000;
# Line 50 | Line 50 | public class MapWordLoops {
50              
51              for (int i = 0; i < numTests; ++i) {
52                  Map<String,String> m = newMap(mapClass);
53 <                long t = doTest(mapClass.getName(), m, key);
53 >                long t = doTest(i, mapClass.getName(), m, key);
54                  if (t < least) least = t;
55                  m.clear();
56                  m = null;
# Line 104 | Line 104 | public class MapWordLoops {
104          return array;
105      }
106  
107 <    static long doTest(String name,
107 >    static long doTest(int id, String name,
108                         final Map<String,String> m,
109                         final String[] key) {
110  
111          //    System.out.print(name + "\t");
112 <        Runner runner = new Runner(m, key);
112 >        Runner runner = new Runner(id, m, key);
113          long startTime = System.currentTimeMillis();
114          runner.run();
115          long afterRun = System.currentTimeMillis();
# Line 128 | Line 128 | public class MapWordLoops {
128      static class Runner implements Runnable {
129          final Map<String,String> map;
130          final String[] key;
131 <        LoopHelpers.SimpleRandom rng = new LoopHelpers.SimpleRandom();
131 >        LoopHelpers.SimpleRandom rng;
132          final int pctrem;
133          final int pctins;
134          int nputs = 0;
# Line 138 | Line 138 | public class MapWordLoops {
138          volatile int total;
139          int maxsz;
140  
141 <        Runner(Map<String,String> m, String[] k) {
141 >        Runner(int id, Map<String,String> m, String[] k) {
142              map = m; key = k;
143              pctrem = (int)(((long)premove * (long)(Integer.MAX_VALUE/2)) / 50);
144              pctins = (int)(((long)pinsert * (long)(Integer.MAX_VALUE/2)) / 50);
145 +            rng = new LoopHelpers.SimpleRandom((id + 1) * 8862213513L);
146          }
147  
148  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines