jdk/test/java/util/ArrayList/IteratorMicroBenchmark.java
author ohair
Tue, 22 Jun 2010 17:26:32 -0700
changeset 5967 26b773bf22ea
parent 5506 202f599c92aa
child 42319 0193886267c3
permissions -rw-r--r--
6933622: Duplicate class files in rt.jar and charsets.jar 6895003: JarReorder is not excluding a requested file. Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
 * This is not a regression test, but a micro-benchmark.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
 * Be patient; this runs for half an hour!
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 * I have run this as follows:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * for f in -client -server; do mergeBench dolphin . jr -dsa -da $f IteratorMicroBenchmark.java; done
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * @author Martin Buchholz
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import java.util.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import java.util.concurrent.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
import java.util.regex.Pattern;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
public class IteratorMicroBenchmark {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
    abstract static class Job {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
        private final String name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
        public Job(String name) { this.name = name; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
        public String name() { return name; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
        public abstract void work() throws Throwable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    private static void collectAllGarbage() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
        final java.util.concurrent.CountDownLatch drained
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
            = new java.util.concurrent.CountDownLatch(1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
            System.gc();        // enqueue finalizable objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
            new Object() { protected void finalize() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
                drained.countDown(); }};
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
            System.gc();        // enqueue detector
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
            drained.await();    // wait for finalizer queue to drain
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
            System.gc();        // cleanup finalized objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
        } catch (InterruptedException e) { throw new Error(e); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
     * Runs each job for long enough that all the runtime compilers
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     * have had plenty of time to warm up, i.e. get around to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     * compiling everything worth compiling.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     * Returns array of average times per job per run.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    private static long[] time0(Job ... jobs) throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
        final long warmupNanos = 10L * 1000L * 1000L * 1000L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
        long[] nanoss = new long[jobs.length];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
        for (int i = 0; i < jobs.length; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
            collectAllGarbage();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
            long t0 = System.nanoTime();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
            long t;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
            int j = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
            do { jobs[i].work(); j++; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
            while ((t = System.nanoTime() - t0) < warmupNanos);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
            nanoss[i] = t/j;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
        return nanoss;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    private static void time(Job ... jobs) throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
        long[] warmup = time0(jobs); // Warm up run
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
        long[] nanoss = time0(jobs); // Real timing run
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
        long[] milliss = new long[jobs.length];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
        double[] ratios = new double[jobs.length];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
        final String nameHeader   = "Method";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
        final String millisHeader = "Millis";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
        final String ratioHeader  = "Ratio";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
        int nameWidth   = nameHeader.length();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
        int millisWidth = millisHeader.length();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        int ratioWidth  = ratioHeader.length();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        for (int i = 0; i < jobs.length; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
            nameWidth = Math.max(nameWidth, jobs[i].name().length());
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
            milliss[i] = nanoss[i]/(1000L * 1000L);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
            millisWidth = Math.max(millisWidth,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
                                   String.format("%d", milliss[i]).length());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
            ratios[i] = (double) nanoss[i] / (double) nanoss[0];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
            ratioWidth = Math.max(ratioWidth,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
                                  String.format("%.3f", ratios[i]).length());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        String format = String.format("%%-%ds %%%dd %%%d.3f%%n",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
                                      nameWidth, millisWidth, ratioWidth);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        String headerFormat = String.format("%%-%ds %%%ds %%%ds%%n",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
                                            nameWidth, millisWidth, ratioWidth);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        System.out.printf(headerFormat, "Method", "Millis", "Ratio");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
        // Print out absolute and relative times, calibrated against first job
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        for (int i = 0; i < jobs.length; i++)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
            System.out.printf(format, jobs[i].name(), milliss[i], ratios[i]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
    private static String keywordValue(String[] args, String keyword) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
        for (String arg : args)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
            if (arg.startsWith(keyword))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                return arg.substring(keyword.length() + 1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
    private static int intArg(String[] args, String keyword, int defaultValue) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
        String val = keywordValue(args, keyword);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        return val == null ? defaultValue : Integer.parseInt(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
    private static Pattern patternArg(String[] args, String keyword) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        String val = keywordValue(args, keyword);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        return val == null ? null : Pattern.compile(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
    private static Job[] filter(Pattern filter, Job[] jobs) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
        if (filter == null) return jobs;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
        Job[] newJobs = new Job[jobs.length];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
        int n = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        for (Job job : jobs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
            if (filter.matcher(job.name()).find())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
                newJobs[n++] = job;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
        // Arrays.copyOf not available in JDK 5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
        Job[] ret = new Job[n];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
        System.arraycopy(newJobs, 0, ret, 0, n);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
        return ret;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    private static void deoptimize(int sum) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
        if (sum == 42)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
            System.out.println("the answer");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
    private static <T> List<T> asSubList(List<T> list) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
        return list.subList(0, list.size());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    private static <T> Iterable<T> backwards(final List<T> list) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
        return new Iterable<T>() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
            public Iterator<T> iterator() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
                return new Iterator<T>() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
                    final ListIterator<T> it = list.listIterator(list.size());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
                    public boolean hasNext() { return it.hasPrevious(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
                    public T next()          { return it.previous(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
                    public void remove()     {        it.remove(); }};}};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     * Usage: [iterations=N] [size=N] [filter=REGEXP]
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    public static void main(String[] args) throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        final int iterations = intArg(args, "iterations", 100000);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
        final int size       = intArg(args, "size", 1000);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
        final Pattern filter = patternArg(args, "filter");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        final ConcurrentSkipListMap<Integer,Integer> m
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
            = new ConcurrentSkipListMap<Integer,Integer>();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
        final Vector<Integer> v = new Vector<Integer>(size);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
        final ArrayList<Integer> al = new ArrayList<Integer>(size);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
        // Populate collections with random data
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
        final Random rnd = new Random();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
        for (int i = 0; i < size; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
            m.put(rnd.nextInt(size), rnd.nextInt(size));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
            v.add(rnd.nextInt(size));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
        al.addAll(v);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
        // Also test "short" collections
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
        final int shortSize = 5;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
        final Vector<Integer> sv = new Vector<Integer>(v.subList(0, shortSize));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
        final ArrayList<Integer> sal = new ArrayList<Integer>(sv);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
        // Checks for correctness *and* prevents loop optimizations
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
        class Check {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
            private int sum;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
            public void sum(int sum) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
                if (this.sum == 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
                    this.sum = sum;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
                if (this.sum != sum)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
                    throw new AssertionError("Sum mismatch");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        final Check check      = new Check();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
        final Check shortCheck = new Check();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
        Job[] jobs = {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
//          new Job("Vector iterate desugared") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
//              public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
//                  for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
//                      int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
//                      for (Iterator<Integer> it = v.iterator(); it.hasNext();)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
//                          sum += it.next();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
//                      check.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
            new Job("array loop") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
                    Integer[] a = al.toArray(new Integer[0]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
                    for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
                        int size = a.length;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
                        for (int j = 0; j < size; ++j)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
                            sum += a[j];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
                        check.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
            new Job("Vector get loop") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
                    for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
                        int size = v.size();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
                        for (int j = 0; j < size; ++j)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
                            sum += v.get(j);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
                        check.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
            new Job("Vector iterate for loop") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
                    for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
                        for (Integer n : v)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
                            sum += n;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
                        check.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
            new Job("Vector descending listIterator loop") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
                    for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
                        ListIterator<Integer> it = v.listIterator(al.size());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
                        while (it.hasPrevious())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
                            sum += it.previous();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
                        check.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
            new Job("Vector Enumeration loop") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
                    for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
                        Enumeration<Integer> it = v.elements();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
                        while (it.hasMoreElements())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
                            sum += it.nextElement();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
                        check.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
            new Job("Vector subList iterate for loop") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
                    for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
                        for (Integer n : asSubList(v))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
                            sum += n;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
                        check.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
            new Job("Vector subList subList subList iterate for loop") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
                    for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
                        for (Integer n : asSubList(asSubList(asSubList(v))))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
                            sum += n;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
                        check.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
            new Job("Vector backwards wrapper ListIterator for loop") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
                    for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
                        for (Integer n : backwards(v))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
                            sum += n;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
                        check.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
            new Job("Vector backwards wrapper subList ListIterator for loop") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
                    for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
                        for (Integer n : backwards(asSubList(v)))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
                            sum += n;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
                        check.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
//          new Job("Vector iterate for loop invokeinterface") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
//              public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
//                  final List<Integer> l = v;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
//                  for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
//                      int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
//                      for (Integer n : l)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
//                          sum += n;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
//                      check.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
//          new Job("Vector subList iterate for loop invokeinterface") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
//              public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
//                  final List<Integer> l = v;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
//                  for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
//                      int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
//                      for (Integer n : asSubList(l))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
//                          sum += n;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
//                      check.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
            new Job("Short Vector get loop") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
                    for (int i = 0; i < (iterations * size / shortSize); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
                        int size = sv.size();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
                        for (int j = 0; j < size; ++j)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
                            sum += sv.get(j);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
                        shortCheck.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
            new Job("Short Vector iterate for loop") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
                    for (int i = 0; i < (iterations * size / shortSize); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
                        for (Integer n : sv)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
                            sum += n;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
                        shortCheck.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
            new Job("Short Vector sublist iterate for loop") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
                    for (int i = 0; i < (iterations * size / shortSize); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
                        for (Integer n : asSubList(sv))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
                            sum += n;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
                        shortCheck.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
            new Job("ArrayList get loop") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
                    for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
                        int size = al.size();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
                        for (int j = 0; j < size; ++j)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
                            sum += al.get(j);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
                        check.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
            new Job("ArrayList iterate for loop") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
                    for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
                        for (Integer n : al)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
                            sum += n;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
                        check.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
            new Job("ArrayList descending listIterator loop") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
                    for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
                        ListIterator<Integer> it = al.listIterator(al.size());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
                        while (it.hasPrevious())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
                            sum += it.previous();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
                        check.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
            new Job("ArrayList listIterator loop") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
                    for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
                        ListIterator<Integer> it = al.listIterator();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
                        while (it.hasNext())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
                            sum += it.next();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
                        check.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
            new Job("ArrayList subList get loop") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
                    List<Integer> sl = asSubList(al);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
                    for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
                        int size = sl.size();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
                        for (int j = 0; j < size; ++j)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
                            sum += sl.get(j);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
                        check.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
            new Job("ArrayList subList iterate for loop") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
                    for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
                        for (Integer n : asSubList(al))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
                            sum += n;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
                        check.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
            new Job("ArrayList subList subList subList iterate for loop") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
                    for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
                        for (Integer n : asSubList(asSubList(asSubList(al))))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
                            sum += n;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
                        check.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
            new Job("ArrayList backwards wrapper ListIterator for loop") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
                    for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
                        for (Integer n : backwards(al))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
                            sum += n;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
                        check.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
            new Job("ArrayList backwards wrapper subList ListIterator for loop") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
                    for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
                        for (Integer n : backwards(asSubList(al)))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
                            sum += n;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
                        check.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
//          new Job("ArrayList iterate desugared") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
//              public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
//                  for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
//                      int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
//                      for (Iterator<Integer> it = al.iterator(); it.hasNext();)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
//                          sum += it.next();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
//                      check.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
            new Job("Short ArrayList get loop") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
                    for (int i = 0; i < (iterations * size / shortSize); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
                        int size = sal.size();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
                        for (int j = 0; j < size; ++j)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
                            sum += sal.get(j);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
                        shortCheck.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
            new Job("Short ArrayList iterate for loop") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
                    for (int i = 0; i < (iterations * size / shortSize); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
                        for (Integer n : sal)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
                            sum += n;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
                        shortCheck.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
            new Job("Short ArrayList sublist iterate for loop") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
                    for (int i = 0; i < (iterations * size / shortSize); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
                        for (Integer n : asSubList(sal))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
                            sum += n;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
                        shortCheck.sum(sum);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
            new Job("Vector ArrayList alternating iteration") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
                    for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
                        Iterator<Integer> it1 = v.iterator();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
                        Iterator<Integer> it2 = al.iterator();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
                        while (it1.hasNext())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
                            sum += it1.next() + it2.next();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
                        check.sum(sum/2);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
            new Job("Vector ArrayList alternating invokeVirtual iteration") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
                    for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
                        List<Iterator<Integer>> its
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
                            = new ArrayList<Iterator<Integer>>(2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
                        its.add(v.iterator());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
                        its.add(al.iterator());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
                        for (int k = 0; its.get(k).hasNext(); k = (k == 0) ? 1 : 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
                            sum += its.get(k).next();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
                        check.sum(sum/2);}}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
            new Job("ConcurrentSkipListMap entrySet iterate") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
                public void work() throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
                    for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
                        int sum = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
                        for (Map.Entry<Integer,Integer> e : m.entrySet())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
                            sum += e.getKey();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
                        deoptimize(sum);}}}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
        };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
        time(filter(filter, jobs));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
}