From e39a8082e36a97868e051175064962335da3c43e Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Tue, 14 Jan 2025 20:42:13 +0000 Subject: [PATCH] benchmark: add input "many ascending runs" --- .../uni_marburg/powersort/benchmark/JmhCgl.java | 2 +- .../de/uni_marburg/powersort/data/CglEnum.java | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/app/src/jmh/java/de/uni_marburg/powersort/benchmark/JmhCgl.java b/app/src/jmh/java/de/uni_marburg/powersort/benchmark/JmhCgl.java index ad47b4b..6f146b0 100644 --- a/app/src/jmh/java/de/uni_marburg/powersort/benchmark/JmhCgl.java +++ b/app/src/jmh/java/de/uni_marburg/powersort/benchmark/JmhCgl.java @@ -18,7 +18,7 @@ import org.openjdk.jmh.annotations.State; public class JmhCgl extends JmhBase { // Either all or a selection of input lists. @Param() - //@Param({"ASCENDING_RUNS", "ASCENDING_RUNS_WITH_OVERLAP"}) + //@Param({"ASCENDING_RUNS", "ASCENDING_RUNS_WITH_OVERLAP", "MANY_ASCENDING_RUNS", "MANY_ASCENDING_RUNS_WITH_OVERLAP"}) CglEnum dataEnum; // Either all or a selection of sort implementations. diff --git a/app/src/main/java/de/uni_marburg/powersort/data/CglEnum.java b/app/src/main/java/de/uni_marburg/powersort/data/CglEnum.java index 114d2dd..a7a37bd 100644 --- a/app/src/main/java/de/uni_marburg/powersort/data/CglEnum.java +++ b/app/src/main/java/de/uni_marburg/powersort/data/CglEnum.java @@ -8,7 +8,9 @@ public enum CglEnum implements DataEnum { ASCENDING_INTEGERS, DESCENDING_INTEGERS, ASCENDING_RUNS, - ASCENDING_RUNS_WITH_OVERLAP; + ASCENDING_RUNS_WITH_OVERLAP, + MANY_ASCENDING_RUNS, + MANY_ASCENDING_RUNS_WITH_OVERLAP; @Override public ObjectSupplier getObjectSupplier() { @@ -17,13 +19,17 @@ public enum CglEnum implements DataEnum { final long seed = 140506881906827520L; // (long) 'P' * (long) 'O' *(long) 'W' * (long) 'E' * (long) 'R' * (long) 'S' * (long) 'O' * (long) 'R' * (long) 'T'; int listSize = 66_000_000; - int runs = 3010; - int runLength = 3010; + int runs = 3_010; + int runLength = 3_010; + + int manyRuns = 30_000; + int shortRunLength = 50; // Constant factors double a = 0.96; double b = 0.25; double c = 0.81; + double d = 1.0; return switch (this) { case RANDOM_INTEGERS -> new RandomIntegers(listSize, seed); @@ -32,6 +38,9 @@ public enum CglEnum implements DataEnum { case ASCENDING_RUNS -> AscendingRuns.newAscendingRuns(runs, runLength, -1 * runLength); case ASCENDING_RUNS_WITH_OVERLAP -> AscendingRuns.newAscendingRuns((int) (c * runs), (int) (c * runLength), (int) (-0.5 * c * runLength)); + case MANY_ASCENDING_RUNS -> AscendingRuns.newAscendingRuns(manyRuns, shortRunLength, -1 * shortRunLength); + case MANY_ASCENDING_RUNS_WITH_OVERLAP -> + AscendingRuns.newAscendingRuns((int) (d * manyRuns), (int) (d * shortRunLength), (int) (-0.5 * d * shortRunLength)); }; } }