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

Comparing jsr166/src/test/loops/DenseMapMicroBenchmark.java (file contents):
Revision 1.1 by dl, Mon Jun 8 14:09:45 2009 UTC vs.
Revision 1.4 by jsr166, Tue Nov 3 01:04:02 2009 UTC

# Line 34 | Line 34 | public class DenseMapMicroBenchmark {
34              long t0 = System.nanoTime();
35              long t;
36              int j = 0;
37 <            do {
38 <                j++;
39 <                jobs[i].work();
37 >            do {
38 >                j++;
39 >                jobs[i].work();
40              } while ((t = System.nanoTime() - t0) < nanos);
41              jobs[i].nanos = t / j;
42              jobs[i].runs = j;
# Line 65 | Line 65 | public class DenseMapMicroBenchmark {
65          // Print out absolute and relative times, calibrated against first job
66          for (int i = 0; i < jobs.length; i++) {
67              long time = jobs[i].nanos/itemsPerTest;
68 <            double ratio = (double)jobs[i].nanos / (double)jobs[0].nanos;
68 >            double ratio = (double) jobs[i].nanos / (double) jobs[0].nanos;
69              System.out.printf(format, jobs[i].name(), time, ratio);
70          }
71      }
# Line 113 | Line 113 | public class DenseMapMicroBenchmark {
113          public void work() {
114              Map m = null;
115              try {
116 <                m = (Map)mapClass.newInstance();
117 <            } catch(Exception e) {
116 >                m = (Map) mapClass.newInstance();
117 >            } catch (Exception e) {
118                  throw new RuntimeException("Can't instantiate " + mapClass + ": " + e);
119              }
120              final int len = elts.length;
# Line 197 | Line 197 | public class DenseMapMicroBenchmark {
197      }
198  
199   }
200

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines