1 |
|
/* |
2 |
|
* Written by Doug Lea with assistance from members of JCP JSR-166 |
3 |
|
* Expert Group and released to the public domain, as explained at |
4 |
< |
* http://creativecommons.org/licenses/publicdomain |
4 |
> |
* http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
|
*/ |
6 |
|
|
7 |
|
import java.util.*; |
47 |
|
time0(NANOS_PER_JOB, jobs); |
48 |
|
|
49 |
|
final String nameHeader = "Method"; |
50 |
< |
int nameWidth = nameHeader.length(); |
50 |
> |
int nameWidth = nameHeader.length(); |
51 |
|
for (Job job : jobs) |
52 |
|
nameWidth = Math.max(nameWidth, job.name().length()); |
53 |
|
|
54 |
|
final int itemsPerTest = SIZE * OPS_PER_ITER * ITERS_PER_TEST; |
55 |
|
final String timeHeader = "Nanos/item"; |
56 |
< |
int timeWidth = timeHeader.length(); |
56 |
> |
int timeWidth = timeHeader.length(); |
57 |
|
final String ratioHeader = "Ratio"; |
58 |
|
int ratioWidth = ratioHeader.length(); |
59 |
|
String format = String.format("%%-%ds %%%dd %%.3f%%n", |
103 |
|
|
104 |
|
static final class Hasher extends Job { |
105 |
|
final Object[] elts; |
106 |
< |
final Class mapClass; |
106 |
> |
final Class<?> mapClass; |
107 |
|
volatile int matches; |
108 |
< |
Hasher(String name, Object[] elts, Class mapClass) { |
108 |
> |
Hasher(String name, Object[] elts, Class<?> mapClass) { |
109 |
|
super(name); |
110 |
|
this.elts = elts; |
111 |
|
this.mapClass = mapClass; |
151 |
|
} |
152 |
|
|
153 |
|
public static void main(String[] args) throws Throwable { |
154 |
< |
Class mc = java.util.HashMap.class; |
154 |
> |
Class<?> mc = java.util.HashMap.class; |
155 |
|
if (args.length > 0) |
156 |
|
mc = Class.forName(args[0]); |
157 |
|
if (args.length > 1) |