ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/jtreg/util/Collection/IteratorMicroBenchmark.java
(Generate patch)

Comparing jsr166/src/test/jtreg/util/Collection/IteratorMicroBenchmark.java (file contents):
Revision 1.6 by jsr166, Mon Nov 21 01:02:40 2016 UTC vs.
Revision 1.7 by jsr166, Mon Nov 21 01:30:03 2016 UTC

# Line 331 | Line 331 | public class IteratorMicroBenchmark {
331                          x.toArray(a);
332                          for (Object o : a)
333                              sum[0] += (Integer) o;
334 +                        check.sum(sum[0]);}}},
335 +            new Job(klazz + " .toArray(empty)") {
336 +                public void work() throws Throwable {
337 +                    Integer[] empty = new Integer[0];
338 +                    int[] sum = new int[1];
339 +                    for (int i = 0; i < iterations; i++) {
340 +                        sum[0] = 0;
341 +                        for (Integer o : x.toArray(empty))
342 +                            sum[0] += o;
343                          check.sum(sum[0]);}}});
344      }
345  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines