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

Comparing jsr166/src/test/extra166y/FilterDemo.java (file contents):
Revision 1.1 by dl, Sun Nov 1 22:00:35 2009 UTC vs.
Revision 1.2 by jsr166, Mon Nov 16 04:16:43 2009 UTC

# Line 16 | Line 16 | public class FilterDemo {
16      /**
17       * Sequential version, for performance comparison
18       */
19 <    static<T> List<T> seqFilter(T[] list,
19 >    static<T> List<T> seqFilter(T[] list,
20                                  Ops.Predicate<T> pred) {
21          ArrayList<T> result = new ArrayList<T>();
22          int n = list.length;
# Line 56 | Line 56 | public class FilterDemo {
56      public static void main(String[] args) throws Exception {
57          int n = 1 << 9;
58          Rand[] array = new Rand[n];
59 <        for (int i = 0; i < n; ++i)
59 >        for (int i = 0; i < n; ++i)
60              array[i] = new Rand(i);
61          final IsPrime pred = new IsPrime();
62          final NextRand nextRand = new NextRand();
# Line 78 | Line 78 | public class FilterDemo {
78              elapsed = (double)(now - last) / NPS;
79              last = now;
80              System.out.printf("seq:    %7.3f\n", elapsed);
81 <            //            for (Rand r : array) r.next();
81 >            //            for (Rand r : array) r.next();
82          }
83          int pass = 0;
84          int ps = 2;
# Line 99 | Line 99 | public class FilterDemo {
99                  System.out.printf("ps %2d:  %7.3f\n", ps, elapsed);
100              }
101              if (pass == 0) {
102 <                if (ps >= NCPU)
102 >                if (ps >= NCPU)
103                      pass = 1;
104                  else
105                      ps <<= 1;
# Line 138 | Line 138 | public class FilterDemo {
138          }
139  
140          public String toString() {
141 <            return String.valueOf(seed);
141 >            return String.valueOf(seed);
142          }
143      }
144  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines