BAEL-4876: Add more data

This commit is contained in:
Daniel Strmecki 2021-05-09 20:29:29 +02:00
parent 86c36061c9
commit 2c5bd5e207
3 changed files with 7 additions and 7 deletions

View File

@ -17,7 +17,7 @@ public class DifferentSourceSplitting {
private static final List<Integer> linkedListOfNumbers = new LinkedList<>(); private static final List<Integer> linkedListOfNumbers = new LinkedList<>();
static { static {
IntStream.rangeClosed(1, 100_000).forEach(i -> { IntStream.rangeClosed(1, 1_000_000).forEach(i -> {
arrayListOfNumbers.add(i); arrayListOfNumbers.add(i);
linkedListOfNumbers.add(i); linkedListOfNumbers.add(i);
}); });

View File

@ -11,11 +11,11 @@ import java.util.stream.IntStream;
public class MemoryLocalityCosts { public class MemoryLocalityCosts {
private static final int[] intArray = new int[100_000]; private static final int[] intArray = new int[1_000_000];
private static final Integer[] integerArray = new Integer[100_000]; private static final Integer[] integerArray = new Integer[1_000_000];
static { static {
IntStream.rangeClosed(1, 100_000).forEach(i -> { IntStream.rangeClosed(1, 1_000_000).forEach(i -> {
intArray[i-1] = i; intArray[i-1] = i;
integerArray[i-1] = i; integerArray[i-1] = i;
}); });

View File

@ -16,7 +16,7 @@ public class MergingCosts {
private static final List<Integer> arrayListOfNumbers = new ArrayList<>(); private static final List<Integer> arrayListOfNumbers = new ArrayList<>();
static { static {
IntStream.rangeClosed(1, 100_000).forEach(i -> { IntStream.rangeClosed(1, 1_000_000).forEach(i -> {
arrayListOfNumbers.add(i); arrayListOfNumbers.add(i);
}); });
} }
@ -39,14 +39,14 @@ public class MergingCosts {
@BenchmarkMode(Mode.AverageTime) @BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS) @OutputTimeUnit(TimeUnit.NANOSECONDS)
public static void mergingCostsGroupingSequential() { public static void mergingCostsGroupingSequential() {
arrayListOfNumbers.stream().collect(Collectors.groupingBy(i -> i % 2 == 0)); arrayListOfNumbers.stream().collect(Collectors.toSet());
} }
@Benchmark @Benchmark
@BenchmarkMode(Mode.AverageTime) @BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS) @OutputTimeUnit(TimeUnit.NANOSECONDS)
public static void mergingCostsGroupingParallel() { public static void mergingCostsGroupingParallel() {
arrayListOfNumbers.stream().parallel().collect(Collectors.groupingBy(i -> i % 2 == 0)); arrayListOfNumbers.stream().parallel().collect(Collectors.toSet());
} }
} }