--- jsr166/src/test/loops/MapMicroBenchmark.java 2009/11/03 01:04:02 1.8 +++ jsr166/src/test/loops/MapMicroBenchmark.java 2011/07/15 13:21:33 1.11 @@ -1,7 +1,7 @@ /* * Written by Doug Lea with assistance from members of JCP JSR-166 * Expert Group and released to the public domain, as explained at - * http://creativecommons.org/licenses/publicdomain + * http://creativecommons.org/publicdomain/zero/1.0/ */ import java.util.*; @@ -143,7 +143,7 @@ public class MapMicroBenchmark { warmup1(mixed); warmup3(jobs); Thread.sleep(500); - time(jobs); + time(jobs); } static void runWork(Job[] jobs, int minIters, int maxIters, long timeLimit) throws Throwable { @@ -193,7 +193,7 @@ public class MapMicroBenchmark { long[] aves = new long[nsizes]; int njobs = jobs.length; - for (int i = 0; i < njobs; i++) { + for (int i = 0; i < njobs; i++) { System.out.print(jobs[i].name); for (int k = 0; k < nsizes; ++k) { long nanos = jobs[i].nanos[k]; @@ -212,7 +212,7 @@ public class MapMicroBenchmark { static final class Job { - final String name; + final String name; final Class elementClass; long[] nanos = new long[nsizes]; final Object[] items; @@ -334,6 +334,12 @@ public class MapMicroBenchmark { if (m.put(x, x) == null) ++sum; } + /* // uncomment to avoid calling clear() + for (int i = 0; i < len; ++i) { + Object x = keys[i]; + m.remove(x); + } + */ m.clear(); sum += len - (quarter * 2); checkSum += sum ^ (sum << 12);