408 |
|
for (int i = 0; i < iterations; i++) { |
409 |
|
check.sum(x.stream() |
410 |
|
.collect(summingInt(e -> e)));}}}, |
411 |
+ |
new Job(klazz + " stream().iterator()") { |
412 |
+ |
public void work() throws Throwable { |
413 |
+ |
int[] sum = new int[1]; |
414 |
+ |
for (int i = 0; i < iterations; i++) { |
415 |
+ |
sum[0] = 0; |
416 |
+ |
for (Integer o : (Iterable<Integer>) x.stream()::iterator) |
417 |
+ |
sum[0] += o; |
418 |
+ |
check.sum(sum[0]);}}}, |
419 |
|
new Job(klazz + " parallelStream().forEach") { |
420 |
|
public void work() throws Throwable { |
421 |
|
for (int i = 0; i < iterations; i++) { |
430 |
|
public void work() throws Throwable { |
431 |
|
for (int i = 0; i < iterations; i++) { |
432 |
|
check.sum(x.parallelStream() |
433 |
< |
.collect(summingInt(e -> e)));}}}); |
433 |
> |
.collect(summingInt(e -> e)));}}}, |
434 |
> |
new Job(klazz + " stream().iterator()") { |
435 |
> |
public void work() throws Throwable { |
436 |
> |
int[] sum = new int[1]; |
437 |
> |
for (int i = 0; i < iterations; i++) { |
438 |
> |
sum[0] = 0; |
439 |
> |
for (Integer o : (Iterable<Integer>) x.parallelStream()::iterator) |
440 |
> |
sum[0] += o; |
441 |
> |
check.sum(sum[0]);}}}); |
442 |
|
} |
443 |
|
|
444 |
|
List<Job> dequeJobs(Deque<Integer> x) { |