use of org.eclipse.collections.impl.math.LongSum in project eclipse-collections by eclipse.
the class ParallelArrayIterateTest method parallelForEachPerformanceTwoThreads.
@Test
public void parallelForEachPerformanceTwoThreads() throws InterruptedException {
Object[] array = Interval.zeroTo(100).toArray();
Sum parallelSum1 = new LongSum(0);
Sum parallelSum2 = new LongSum(0);
this.basicTestParallelSums(array, parallelSum1, parallelSum2);
Sum linearSum1 = new LongSum(0);
Sum linearSum2 = new LongSum(0);
this.basicTestLinearSums(array, linearSum1, linearSum2);
Assert.assertEquals(parallelSum1, linearSum1);
Assert.assertEquals(parallelSum2, linearSum2);
}
use of org.eclipse.collections.impl.math.LongSum in project eclipse-collections by eclipse.
the class ParallelArrayIterateTest method parallelForEachPerformanceOneThread.
@Test
public void parallelForEachPerformanceOneThread() {
Object[] array = Interval.zeroTo(100).toArray();
Sum parallelSum = new LongSum(0);
this.parallelSum(array, parallelSum);
Sum linearSum = new LongSum(0);
this.linearSum(array, linearSum);
Assert.assertEquals(parallelSum, linearSum);
}
Aggregations