jdk/test/java/util/ArrayList/RangeCheckMicroBenchmark.java
author kvn
Thu, 05 Dec 2013 15:13:12 -0800
changeset 22858 f4a6f0eba875
parent 5506 202f599c92aa
child 43522 f9c6f543c4db
permissions -rw-r--r--
Merge
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
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 * I have run this as follows:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 * repeat 5 for f in -client -server; do mergeBench dolphin . jr -dsa -da $f RangeCheckMicroBenchmark.java; done
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * @author Martin Buchholz
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import java.util.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import java.util.regex.Pattern;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import java.util.concurrent.CountDownLatch;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
public class RangeCheckMicroBenchmark {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
    abstract static class Job {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
        private final String name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
        Job(String name) { this.name = name; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
        String name() { return name; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
        abstract void work() throws Throwable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    private static void collectAllGarbage() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
        final CountDownLatch drained = new CountDownLatch(1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
            System.gc();        // enqueue finalizable objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
            new Object() { protected void finalize() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
                drained.countDown(); }};
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
            System.gc();        // enqueue detector
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
            drained.await();    // wait for finalizer queue to drain
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
            System.gc();        // cleanup finalized objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
        } catch (InterruptedException e) { throw new Error(e); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     * Runs each job for long enough that all the runtime compilers
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     * have had plenty of time to warm up, i.e. get around to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
     * compiling everything worth compiling.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     * Returns array of average times per job per run.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    private static long[] time0(Job ... jobs) throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
        final long warmupNanos = 10L * 1000L * 1000L * 1000L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        long[] nanoss = new long[jobs.length];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
        for (int i = 0; i < jobs.length; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
            collectAllGarbage();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
            long t0 = System.nanoTime();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
            long t;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
            int j = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
            do { jobs[i].work(); j++; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
            while ((t = System.nanoTime() - t0) < warmupNanos);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
            nanoss[i] = t/j;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
        return nanoss;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    private static void time(Job ... jobs) throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
        long[] warmup = time0(jobs); // Warm up run
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
        long[] nanoss = time0(jobs); // Real timing run
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
        long[] milliss = new long[jobs.length];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
        double[] ratios = new double[jobs.length];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
        final String nameHeader   = "Method";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
        final String millisHeader = "Millis";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
        final String ratioHeader  = "Ratio";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
        int nameWidth   = nameHeader.length();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
        int millisWidth = millisHeader.length();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
        int ratioWidth  = ratioHeader.length();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        for (int i = 0; i < jobs.length; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
            nameWidth = Math.max(nameWidth, jobs[i].name().length());
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
            milliss[i] = nanoss[i]/(1000L * 1000L);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
            millisWidth = Math.max(millisWidth,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
                                   String.format("%d", milliss[i]).length());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
            ratios[i] = (double) nanoss[i] / (double) nanoss[0];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
            ratioWidth = Math.max(ratioWidth,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
                                  String.format("%.3f", ratios[i]).length());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        String format = String.format("%%-%ds %%%dd %%%d.3f%%n",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
                                      nameWidth, millisWidth, ratioWidth);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        String headerFormat = String.format("%%-%ds %%%ds %%%ds%%n",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
                                            nameWidth, millisWidth, ratioWidth);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        System.out.printf(headerFormat, "Method", "Millis", "Ratio");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        // Print out absolute and relative times, calibrated against first job
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        for (int i = 0; i < jobs.length; i++)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
            System.out.printf(format, jobs[i].name(), milliss[i], ratios[i]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
    private static String keywordValue(String[] args, String keyword) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
        for (String arg : args)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
            if (arg.startsWith(keyword))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
                return arg.substring(keyword.length() + 1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
        return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    private static int intArg(String[] args, String keyword, int defaultValue) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
        String val = keywordValue(args, keyword);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        return val == null ? defaultValue : Integer.parseInt(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    private static Pattern patternArg(String[] args, String keyword) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
        String val = keywordValue(args, keyword);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
        return val == null ? null : Pattern.compile(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
    private static Job[] filter(Pattern filter, Job[] jobs) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
        if (filter == null) return jobs;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        Job[] newJobs = new Job[jobs.length];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
        int n = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
        for (Job job : jobs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
            if (filter.matcher(job.name()).find())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
                newJobs[n++] = job;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
        // Arrays.copyOf not available in JDK 5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
        Job[] ret = new Job[n];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
        System.arraycopy(newJobs, 0, ret, 0, n);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
        return ret;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
    private static void deoptimize(ArrayList<Integer> list) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
        for (Integer x : list)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
            if (x == null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
                throw new Error();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * Usage: [iterations=N] [size=N] [filter=REGEXP]
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    public static void main(String[] args) throws Throwable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        final int iterations = intArg(args, "iterations", 30000);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
        final int size       = intArg(args, "size", 1000);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
        final Pattern filter = patternArg(args, "filter");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        final ArrayList<Integer> list = new ArrayList<Integer>();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
        final Random rnd = new Random();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        for (int i = 0; i < size; i++)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
            list.add(rnd.nextInt());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
        final Job[] jobs = {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
            new Job("get") { void work() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
                for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
                    for (int k = 0; k < size; k++)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
                        if (list.get(k) == 42)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
                            throw new Error();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
                deoptimize(list);}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
            new Job("set") { void work() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
                Integer[] xs = list.toArray(new Integer[size]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
                for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
                    for (int k = 0; k < size; k++)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
                        list.set(k, xs[k]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
                deoptimize(list);}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
            new Job("get/set") { void work() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
                for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
                    for (int k = 0; k < size; k++)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
                        list.set(k, list.get(size - k - 1));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
                deoptimize(list);}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
            new Job("add/remove at end") { void work() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
                Integer x = rnd.nextInt();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
                for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
                    for (int k = 0; k < size - 1; k++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
                        list.add(size, x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
                        list.remove(size);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
                deoptimize(list);}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
            new Job("subList get") { void work() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
                List<Integer> sublist = list.subList(0, list.size());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
                for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
                    for (int k = 0; k < size; k++)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
                        if (sublist.get(k) == 42)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
                            throw new Error();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
                deoptimize(list);}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
            new Job("subList set") { void work() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
                List<Integer> sublist = list.subList(0, list.size());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
                Integer[] xs = sublist.toArray(new Integer[size]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
                for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
                    for (int k = 0; k < size; k++)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
                        sublist.set(k, xs[k]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
                deoptimize(list);}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
            new Job("subList get/set") { void work() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
                List<Integer> sublist = list.subList(0, list.size());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
                for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
                    for (int k = 0; k < size; k++)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
                        sublist.set(k, sublist.get(size - k - 1));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
                deoptimize(list);}},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
            new Job("subList add/remove at end") { void work() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
                List<Integer> sublist = list.subList(0, list.size());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
                Integer x = rnd.nextInt();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
                for (int i = 0; i < iterations; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
                    for (int k = 0; k < size - 1; k++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
                        sublist.add(size, x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
                        sublist.remove(size);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
                deoptimize(list);}}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
        };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
        time(filter(filter, jobs));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
}