13 |
|
*/ |
14 |
|
public class COWALAddIfAbsentLoops { |
15 |
|
|
16 |
< |
static final int SIZE = 35000; |
16 |
> |
static final int SIZE = Integer.getInteger("size", 35000); |
17 |
|
|
18 |
|
/** |
19 |
|
* Set to 1 for 0% cache hit ratio (every addIfAbsent a cache miss). |
20 |
|
* Set to 2 for 50% cache hit ratio. |
21 |
|
*/ |
22 |
< |
static final int CACHE_HIT_FACTOR = 1; |
22 |
> |
static final int CACHE_HIT_FACTOR = Integer.getInteger("cache.hit.factor", 1); |
23 |
> |
|
24 |
> |
static final int MAX_STRIPES = Integer.getInteger("max.stripes", 4); |
25 |
> |
|
26 |
> |
static final int REPS = Integer.getInteger("reps", 3); |
27 |
|
|
28 |
|
public static void main(String[] args) throws Exception { |
29 |
< |
for (int reps = 0; reps < 4; ++reps) { |
30 |
< |
for (int i = 1; i <= 4; ++i) |
29 |
> |
for (int reps = 0; reps < REPS; ++reps) { |
30 |
> |
for (int i = 1; i <= MAX_STRIPES; ++i) |
31 |
|
test(i); |
32 |
|
} |
33 |
|
} |