benchmark: separate benchmarks

This commit is contained in:
Daniel Langbein 2025-01-07 17:32:18 +00:00
parent 1133c069f8
commit e6ab4f6656
Signed by: langfingaz
GPG Key ID: 6C47C753F0823002
12 changed files with 746 additions and 626 deletions

View File

@ -9,6 +9,8 @@ Implementation of Powersort with the aim of integrating it into OpenJDK. Benchma
* [Tasks](#tasks) * [Tasks](#tasks)
* [Test Cases](#test-cases) * [Test Cases](#test-cases)
* [Benchmark](#benchmark) * [Benchmark](#benchmark)
* [Custom](#custom)
* [JMH](#jmh)
<!-- TOC --> <!-- TOC -->
## Setup ## Setup
@ -86,7 +88,29 @@ Run the task "test":
There are two different benchmarks. One is based on the JMH benchmark framework, the other one is a custom benchmark implementation. There are two different benchmarks. One is based on the JMH benchmark framework, the other one is a custom benchmark implementation.
### Custom
Run custom benchmark:
```shell
./gradlew runCbmCgl
./gradlew runCbmCompetition
```
### JMH
Run JMH benchmark:
```shell ```shell
./gradlew jmh ./gradlew jmh
./gradlew runCustomBenchmark
``` ```
IntelliJ plugin:
The [JMH Java Microbenchmark Harness](https://plugins.jetbrains.com/plugin/7529-jmh-java-microbenchmark-harness) plugin allows running benchmarks from within the IDE in a similar way as JUnit test cases. This can be used for development but yields less accurate results.
Further notes:
- JHM: https://github.com/openjdk/jmh?tab=readme-ov-file#other-build-systems
- We use the JMH Gradle plugin: https://github.com/melix/jmh-gradle-plugin
- Sample JMH Gradle project: https://github.com/twoVersatile/jmhsample

View File

@ -22,7 +22,6 @@ val latestJmhVersion = "1.37"
dependencies { dependencies {
// Use JUnit Jupiter for testing. // Use JUnit Jupiter for testing.
testImplementation(libs.junit.jupiter) testImplementation(libs.junit.jupiter)
testRuntimeOnly("org.junit.platform:junit-platform-launcher") testRuntimeOnly("org.junit.platform:junit-platform-launcher")
// Required to use the IntelliJ plugin "JMH Java Microbenchmark Harness". // Required to use the IntelliJ plugin "JMH Java Microbenchmark Harness".
@ -42,14 +41,21 @@ java {
// It is not possible to rename it. // It is not possible to rename it.
// Thus, we remove it and add two custom named `JavaExec` tasks instead. // Thus, we remove it and add two custom named `JavaExec` tasks instead.
tasks.getByName("run") { tasks.getByName("run") {
enabled = false
description = "This task has been disabled. It does nothing o.O" description = "This task has been disabled. It does nothing o.O"
enabled = false
} }
tasks.register<JavaExec>("runCustomBenchmark") { tasks.register<JavaExec>("runCbmCgl") {
description = "Run Custom Benchmark (CBM) with Custom Generated Lists (CGL)"
group = "application" group = "application"
classpath = sourceSets["main"].runtimeClasspath classpath = sourceSets["main"].runtimeClasspath
mainClass = "de.uni_marburg.powersort.benchmark.Main" mainClass = "de.uni_marburg.powersort.benchmark.CbmCgl"
}
tasks.register<JavaExec>("runCbmCompetition") {
description = "Run Custom Benchmark (CBM) with Powersort competition lists"
group = "application"
classpath = sourceSets["main"].runtimeClasspath
mainClass = "de.uni_marburg.powersort.benchmark.CbmCompetition"
} }
tasks.named<Test>("test") { tasks.named<Test>("test") {

View File

@ -0,0 +1,31 @@
package de.uni_marburg.powersort.benchmark;
import de.uni_marburg.powersort.data.CglEnum;
import de.uni_marburg.powersort.data.DataEnum;
import de.uni_marburg.powersort.sort.SortEnum;
import org.openjdk.jmh.annotations.Param;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.State;
/*
* Benchmark state parameters
*
* Quote from JMH:
* State objects naturally encapsulate the state on which benchmark is working on.
*/
@State(Scope.Benchmark)
public class JmhCgl extends JmhBase {
@Param()
CglEnum dataEnum;
@Param()
SortEnum sortEnum;
@Override
DataEnum getDataEnum(){
return dataEnum;
}
@Override
SortEnum getSortEnum(){
return sortEnum;
}
}

View File

@ -1,5 +1,6 @@
package de.uni_marburg.powersort.benchmark; package de.uni_marburg.powersort.benchmark;
import de.uni_marburg.powersort.data.CompetitionEnum;
import de.uni_marburg.powersort.data.DataEnum; import de.uni_marburg.powersort.data.DataEnum;
import de.uni_marburg.powersort.sort.SortEnum; import de.uni_marburg.powersort.sort.SortEnum;
import org.openjdk.jmh.annotations.Param; import org.openjdk.jmh.annotations.Param;
@ -15,7 +16,7 @@ import org.openjdk.jmh.annotations.State;
@State(Scope.Benchmark) @State(Scope.Benchmark)
public class JmhCompetition extends JmhBase { public class JmhCompetition extends JmhBase {
@Param() @Param()
DataEnum dataEnum; CompetitionEnum dataEnum;
@Param() @Param()
SortEnum sortEnum; SortEnum sortEnum;

View File

@ -7,13 +7,10 @@ import de.uni_marburg.powersort.data.ObjectSupplier;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
/** /**
* Custom benchmark. * Custom Benchmark (CBM).
*/ */
public class Main { public class CbmBase {
public static void main(final String[] args) { static void run(SortEnum[] sortImplementations, DataEnum[] dataEnums) {
final SortEnum[] sortImplementations = SortEnum.values();
final DataEnum[] dataEnums = DataEnum.values();
System.out.println(); System.out.println();
for (DataEnum dataEnum : dataEnums) { for (DataEnum dataEnum : dataEnums) {
ObjectSupplier objectSupplier = null; ObjectSupplier objectSupplier = null;

View File

@ -0,0 +1,13 @@
package de.uni_marburg.powersort.benchmark;
import de.uni_marburg.powersort.data.CglEnum;
import de.uni_marburg.powersort.sort.SortEnum;
public class CbmCgl {
public static void main(String[] args) {
CbmBase.run(
SortEnum.values(),
CglEnum.values()
);
}
}

View File

@ -0,0 +1,13 @@
package de.uni_marburg.powersort.benchmark;
import de.uni_marburg.powersort.data.CompetitionEnum;
import de.uni_marburg.powersort.sort.SortEnum;
public class CbmCompetition {
public static void main(String[] args) {
CbmBase.run(
SortEnum.values(),
CompetitionEnum.values()
);
}
}

View File

@ -1,5 +1,7 @@
package de.uni_marburg.powersort.benchmark; package de.uni_marburg.powersort.benchmark;
import de.uni_marburg.powersort.data.CglEnum;
import de.uni_marburg.powersort.data.CompetitionEnum;
import de.uni_marburg.powersort.data.DataEnum; import de.uni_marburg.powersort.data.DataEnum;
import de.uni_marburg.powersort.data.IntegerSerializer; import de.uni_marburg.powersort.data.IntegerSerializer;
import de.uni_marburg.powersort.sort.SortEnum; import de.uni_marburg.powersort.sort.SortEnum;
@ -7,6 +9,8 @@ import de.uni_marburg.powersort.sort.SortEnum;
import java.nio.file.Files; import java.nio.file.Files;
import java.util.List; import java.util.List;
import static de.uni_marburg.powersort.data.CompetitionEnum.isCompetitionInput;
public class Filter { public class Filter {
/* Utility Class */ /* Utility Class */
private Filter() { private Filter() {
@ -15,22 +19,22 @@ public class Filter {
public static boolean isFiltered(DataEnum d, SortEnum s) { public static boolean isFiltered(DataEnum d, SortEnum s) {
// To skip some of the inputs for all sort algorithms, uncomment them here. // To skip some of the inputs for all sort algorithms, uncomment them here.
// if (List.of( // if (List.of(
// DataEnum.RANDOM_INTEGERS_300M, // CglEnum.RANDOM_INTEGERS_300M,
// DataEnum.ASCENDING_INTEGERS_300M, // CglEnum.ASCENDING_INTEGERS_300M,
// DataEnum.DESCENDING_INTEGERS_250M, // CglEnum.DESCENDING_INTEGERS_250M,
// DataEnum.ASCENDING_RUNS_1M, // CglEnum.ASCENDING_RUNS_1M,
// DataEnum.ASCENDING_RUNS_WITH_OVERLAP_1M // CglEnum.ASCENDING_RUNS_WITH_OVERLAP_1M
// ).contains(d)) { // ).contains(d)) {
// return true; // return true;
// } // }
// To skip all competition inputs, uncomment the next line. // To skip all competition inputs, uncomment the next line.
// if(d.isCompetitionInput()){ // if(isCompetitionInput(d)){
// return true; // return true;
// } // }
// Skip some sort algorithms for all competition inputs. // Skip some sort algorithms for all competition inputs.
if(d.isCompetitionInput()){ if(isCompetitionInput(d)){
if(List.of( if(List.of(
SortEnum.BUBBLE_SORT, SortEnum.BUBBLE_SORT,
SortEnum.MERGE_SORT SortEnum.MERGE_SORT
@ -50,127 +54,127 @@ public class Filter {
if (s == SortEnum.QUICK_SORT) { if (s == SortEnum.QUICK_SORT) {
return List.of( return List.of(
DataEnum.RANDOM_INTEGERS_300M, CglEnum.RANDOM_INTEGERS_300M,
DataEnum.ASCENDING_INTEGERS_300M, CglEnum.ASCENDING_INTEGERS_300M,
DataEnum.DESCENDING_INTEGERS_250M, CglEnum.DESCENDING_INTEGERS_250M,
DataEnum.ASCENDING_RUNS_1M, CglEnum.ASCENDING_RUNS_1M,
DataEnum.ASCENDING_RUNS_WITH_OVERLAP_1M, CglEnum.ASCENDING_RUNS_WITH_OVERLAP_1M,
DataEnum.COMPETITION_34, CompetitionEnum.COMPETITION_34,
DataEnum.COMPETITION_35, CompetitionEnum.COMPETITION_35,
DataEnum.COMPETITION_36, CompetitionEnum.COMPETITION_36,
DataEnum.COMPETITION_37, CompetitionEnum.COMPETITION_37,
DataEnum.COMPETITION_38, CompetitionEnum.COMPETITION_38,
DataEnum.COMPETITION_39, CompetitionEnum.COMPETITION_39,
DataEnum.COMPETITION_83, CompetitionEnum.COMPETITION_83,
DataEnum.COMPETITION_85, CompetitionEnum.COMPETITION_85,
DataEnum.COMPETITION_153, CompetitionEnum.COMPETITION_153,
DataEnum.COMPETITION_163, CompetitionEnum.COMPETITION_163,
DataEnum.COMPETITION_164, CompetitionEnum.COMPETITION_164,
DataEnum.COMPETITION_165, CompetitionEnum.COMPETITION_165,
DataEnum.COMPETITION_166, CompetitionEnum.COMPETITION_166,
DataEnum.COMPETITION_167, CompetitionEnum.COMPETITION_167,
DataEnum.COMPETITION_168, CompetitionEnum.COMPETITION_168,
DataEnum.COMPETITION_169, CompetitionEnum.COMPETITION_169,
DataEnum.COMPETITION_170, CompetitionEnum.COMPETITION_170,
DataEnum.COMPETITION_171, CompetitionEnum.COMPETITION_171,
DataEnum.COMPETITION_172, CompetitionEnum.COMPETITION_172,
DataEnum.COMPETITION_173, CompetitionEnum.COMPETITION_173,
DataEnum.COMPETITION_174, CompetitionEnum.COMPETITION_174,
DataEnum.COMPETITION_181, CompetitionEnum.COMPETITION_181,
DataEnum.COMPETITION_182, CompetitionEnum.COMPETITION_182,
DataEnum.COMPETITION_183, CompetitionEnum.COMPETITION_183,
DataEnum.COMPETITION_184, CompetitionEnum.COMPETITION_184,
DataEnum.COMPETITION_185, CompetitionEnum.COMPETITION_185,
DataEnum.COMPETITION_186, CompetitionEnum.COMPETITION_186,
DataEnum.COMPETITION_187, CompetitionEnum.COMPETITION_187,
DataEnum.COMPETITION_205, CompetitionEnum.COMPETITION_205,
DataEnum.COMPETITION_206, CompetitionEnum.COMPETITION_206,
DataEnum.COMPETITION_207, CompetitionEnum.COMPETITION_207,
DataEnum.COMPETITION_213, CompetitionEnum.COMPETITION_213,
DataEnum.COMPETITION_214, CompetitionEnum.COMPETITION_214,
DataEnum.COMPETITION_216, CompetitionEnum.COMPETITION_216,
DataEnum.COMPETITION_218, CompetitionEnum.COMPETITION_218,
DataEnum.COMPETITION_220, CompetitionEnum.COMPETITION_220,
DataEnum.COMPETITION_222, CompetitionEnum.COMPETITION_222,
DataEnum.COMPETITION_225, CompetitionEnum.COMPETITION_225,
DataEnum.COMPETITION_226, CompetitionEnum.COMPETITION_226,
DataEnum.COMPETITION_228, CompetitionEnum.COMPETITION_228,
DataEnum.COMPETITION_231, CompetitionEnum.COMPETITION_231,
DataEnum.COMPETITION_232, CompetitionEnum.COMPETITION_232,
DataEnum.COMPETITION_235, CompetitionEnum.COMPETITION_235,
DataEnum.COMPETITION_236 CompetitionEnum.COMPETITION_236
).contains(d); ).contains(d);
} }
if (s == SortEnum.MERGE_SORT) { if (s == SortEnum.MERGE_SORT) {
return List.of( return List.of(
DataEnum.RANDOM_INTEGERS_300M, CglEnum.RANDOM_INTEGERS_300M,
DataEnum.ASCENDING_INTEGERS_300M, CglEnum.ASCENDING_INTEGERS_300M,
DataEnum.DESCENDING_INTEGERS_250M CglEnum.DESCENDING_INTEGERS_250M
).contains(d); ).contains(d);
} }
if (s == SortEnum.BUBBLE_SORT) { if (s == SortEnum.BUBBLE_SORT) {
return List.of( return List.of(
DataEnum.DESCENDING_INTEGERS_250M, CglEnum.DESCENDING_INTEGERS_250M,
DataEnum.ASCENDING_RUNS_1M, CglEnum.ASCENDING_RUNS_1M,
DataEnum.ASCENDING_RUNS_WITH_OVERLAP_1M CglEnum.ASCENDING_RUNS_WITH_OVERLAP_1M
).contains(d); ).contains(d);
} }
// TODO: Remove this once performance of FinnSort improved // TODO: Remove this once performance of FinnSort improved
if (s == SortEnum.FINN_SORT) { if (s == SortEnum.FINN_SORT) {
return List.of( return List.of(
DataEnum.DESCENDING_INTEGERS_250M, CglEnum.DESCENDING_INTEGERS_250M,
DataEnum.ASCENDING_RUNS_1M, CglEnum.ASCENDING_RUNS_1M,
DataEnum.COMPETITION_83, CompetitionEnum.COMPETITION_83,
DataEnum.COMPETITION_85, CompetitionEnum.COMPETITION_85,
DataEnum.COMPETITION_153, CompetitionEnum.COMPETITION_153,
DataEnum.COMPETITION_163, CompetitionEnum.COMPETITION_163,
DataEnum.COMPETITION_164, CompetitionEnum.COMPETITION_164,
DataEnum.COMPETITION_165, CompetitionEnum.COMPETITION_165,
DataEnum.COMPETITION_166, CompetitionEnum.COMPETITION_166,
DataEnum.COMPETITION_167, CompetitionEnum.COMPETITION_167,
DataEnum.COMPETITION_168, CompetitionEnum.COMPETITION_168,
DataEnum.COMPETITION_169, CompetitionEnum.COMPETITION_169,
DataEnum.COMPETITION_170, CompetitionEnum.COMPETITION_170,
DataEnum.COMPETITION_171, CompetitionEnum.COMPETITION_171,
DataEnum.COMPETITION_172, CompetitionEnum.COMPETITION_172,
DataEnum.COMPETITION_173, CompetitionEnum.COMPETITION_173,
DataEnum.COMPETITION_174, CompetitionEnum.COMPETITION_174,
DataEnum.COMPETITION_181, CompetitionEnum.COMPETITION_181,
DataEnum.COMPETITION_182, CompetitionEnum.COMPETITION_182,
DataEnum.COMPETITION_183, CompetitionEnum.COMPETITION_183,
DataEnum.COMPETITION_184, CompetitionEnum.COMPETITION_184,
DataEnum.COMPETITION_185, CompetitionEnum.COMPETITION_185,
DataEnum.COMPETITION_186, CompetitionEnum.COMPETITION_186,
DataEnum.COMPETITION_187, CompetitionEnum.COMPETITION_187,
DataEnum.COMPETITION_198, CompetitionEnum.COMPETITION_198,
DataEnum.COMPETITION_199, CompetitionEnum.COMPETITION_199,
DataEnum.COMPETITION_205, CompetitionEnum.COMPETITION_205,
DataEnum.COMPETITION_206, CompetitionEnum.COMPETITION_206,
DataEnum.COMPETITION_207, CompetitionEnum.COMPETITION_207,
DataEnum.COMPETITION_213, CompetitionEnum.COMPETITION_213,
DataEnum.COMPETITION_214, CompetitionEnum.COMPETITION_214,
DataEnum.COMPETITION_216, CompetitionEnum.COMPETITION_216,
DataEnum.COMPETITION_218, CompetitionEnum.COMPETITION_218,
DataEnum.COMPETITION_220, CompetitionEnum.COMPETITION_220,
DataEnum.COMPETITION_222, CompetitionEnum.COMPETITION_222,
DataEnum.COMPETITION_226, CompetitionEnum.COMPETITION_226,
DataEnum.COMPETITION_228, CompetitionEnum.COMPETITION_228,
DataEnum.COMPETITION_231, CompetitionEnum.COMPETITION_231,
DataEnum.COMPETITION_232, CompetitionEnum.COMPETITION_232,
DataEnum.COMPETITION_236 CompetitionEnum.COMPETITION_236
).contains(d); ).contains(d);
} }
// TODO: Remove this once performance of ASort improved // TODO: Remove this once performance of ASort improved
if (s == SortEnum.ASORT) { if (s == SortEnum.ASORT) {
return List.of( return List.of(
DataEnum.COMPETITION_173, CompetitionEnum.COMPETITION_173,
DataEnum.COMPETITION_174 CompetitionEnum.COMPETITION_174
).contains(d); ).contains(d);
} }

View File

@ -0,0 +1,33 @@
package de.uni_marburg.powersort.data;
/**
* Enumeration of Custom Generated Lists (CGL).
*/
public enum CglEnum implements DataEnum{
RANDOM_INTEGERS_300M,
ASCENDING_INTEGERS_300M,
DESCENDING_INTEGERS_250M,
ASCENDING_RUNS_1M,
ASCENDING_RUNS_WITH_OVERLAP_1M;
@Override
public ObjectSupplier getObjectSupplier() {
// We use a seed to get the same random list every time -> Repeatable benchmarks on same input data!
// final long seed = 3651660232967549736L; // System.nanoTime() ++ Math.random()
final long seed = 140506881906827520L; // (long) 'P' * (long) 'O' *(long) 'W' * (long) 'E' * (long) 'R' * (long) 'S' * (long) 'O' * (long) 'R' * (long) 'T';
int longListSize = 300_000_000; // Any larger: Out of Heap Space. TODO GRADLE config
int middleListSize = 250_000_000;
int runs = 1_000;
int runLength = 1_000;
return switch (this) {
case RANDOM_INTEGERS_300M -> new RandomIntegers(longListSize, seed);
case ASCENDING_INTEGERS_300M -> new AscendingIntegers(longListSize);
case DESCENDING_INTEGERS_250M -> new DescendingIntegers(middleListSize);
case ASCENDING_RUNS_1M -> AscendingRuns.newAscendingRuns(runs, runLength, -runLength);
case ASCENDING_RUNS_WITH_OVERLAP_1M ->
AscendingRuns.newAscendingRuns(runs, runLength, (int) (-0.5 * runLength));
};
}
}

View File

@ -0,0 +1,500 @@
package de.uni_marburg.powersort.data;
/**
* Enumeration of integer lists from the Powersort competition.
*/
public enum CompetitionEnum implements DataEnum {
COMPETITION_1,
COMPETITION_2,
COMPETITION_3,
// COMPETITION_4, // Invalid input file.
COMPETITION_5,
COMPETITION_6,
COMPETITION_7,
COMPETITION_8,
COMPETITION_9,
COMPETITION_10,
COMPETITION_11,
COMPETITION_12,
COMPETITION_13,
// COMPETITION_14, // Invalid input file.
COMPETITION_15,
COMPETITION_16,
COMPETITION_17,
COMPETITION_18,
COMPETITION_19,
COMPETITION_20,
COMPETITION_21,
COMPETITION_22,
COMPETITION_23,
COMPETITION_24,
COMPETITION_25,
COMPETITION_26,
COMPETITION_27,
COMPETITION_28,
COMPETITION_29,
COMPETITION_30,
COMPETITION_31,
COMPETITION_32,
COMPETITION_33,
COMPETITION_34,
COMPETITION_35,
COMPETITION_36,
COMPETITION_37,
COMPETITION_38,
COMPETITION_39,
COMPETITION_40,
COMPETITION_41,
COMPETITION_42,
COMPETITION_43,
COMPETITION_44,
COMPETITION_45,
COMPETITION_46,
COMPETITION_47,
COMPETITION_48,
COMPETITION_49,
COMPETITION_50,
COMPETITION_51,
COMPETITION_52,
COMPETITION_53,
COMPETITION_54,
COMPETITION_55,
COMPETITION_56,
COMPETITION_57,
COMPETITION_58,
COMPETITION_59,
COMPETITION_60,
COMPETITION_61,
COMPETITION_62,
COMPETITION_63,
COMPETITION_64,
COMPETITION_65,
COMPETITION_66,
COMPETITION_67,
COMPETITION_68,
COMPETITION_69,
COMPETITION_70,
COMPETITION_71,
COMPETITION_72,
COMPETITION_73,
COMPETITION_74,
COMPETITION_75,
COMPETITION_76,
COMPETITION_77,
COMPETITION_78,
COMPETITION_79,
COMPETITION_80,
COMPETITION_81,
COMPETITION_82,
COMPETITION_83,
COMPETITION_84,
COMPETITION_85,
COMPETITION_86,
COMPETITION_87,
COMPETITION_88,
COMPETITION_89,
COMPETITION_90,
COMPETITION_91,
COMPETITION_92,
COMPETITION_93,
COMPETITION_94,
COMPETITION_95,
COMPETITION_96,
COMPETITION_97,
// COMPETITION_98, // Invalid input file (floats not integers).
COMPETITION_99,
COMPETITION_100,
COMPETITION_101,
COMPETITION_102,
COMPETITION_103,
COMPETITION_104,
COMPETITION_105,
COMPETITION_106,
COMPETITION_107,
COMPETITION_108,
COMPETITION_109,
COMPETITION_110,
COMPETITION_111,
COMPETITION_112,
COMPETITION_113,
COMPETITION_114,
COMPETITION_115,
COMPETITION_116,
COMPETITION_117,
COMPETITION_118,
COMPETITION_119,
COMPETITION_120,
COMPETITION_121,
COMPETITION_122,
COMPETITION_123,
COMPETITION_124,
COMPETITION_125,
COMPETITION_126,
COMPETITION_127,
COMPETITION_128,
COMPETITION_129,
COMPETITION_130,
COMPETITION_131,
COMPETITION_132,
COMPETITION_133,
COMPETITION_134,
COMPETITION_135,
COMPETITION_136,
COMPETITION_137,
COMPETITION_138,
COMPETITION_139,
COMPETITION_140,
COMPETITION_141,
COMPETITION_142,
COMPETITION_143,
COMPETITION_144,
COMPETITION_145,
COMPETITION_146,
COMPETITION_147,
COMPETITION_148,
COMPETITION_149,
COMPETITION_150,
COMPETITION_151,
COMPETITION_152,
COMPETITION_153,
COMPETITION_154,
COMPETITION_155,
COMPETITION_156,
COMPETITION_157,
COMPETITION_158,
COMPETITION_159,
COMPETITION_160,
COMPETITION_161,
COMPETITION_162,
COMPETITION_163,
COMPETITION_164,
COMPETITION_165,
COMPETITION_166,
COMPETITION_167,
COMPETITION_168,
COMPETITION_169,
COMPETITION_170,
COMPETITION_171,
COMPETITION_172,
COMPETITION_173,
COMPETITION_174,
COMPETITION_175,
COMPETITION_176,
COMPETITION_177,
COMPETITION_178,
COMPETITION_179,
COMPETITION_180,
COMPETITION_181,
COMPETITION_182,
COMPETITION_183,
COMPETITION_184,
COMPETITION_185,
COMPETITION_186,
COMPETITION_187,
COMPETITION_188,
COMPETITION_189,
COMPETITION_190,
COMPETITION_191,
COMPETITION_192,
COMPETITION_193,
COMPETITION_194,
COMPETITION_195,
COMPETITION_196,
COMPETITION_197,
COMPETITION_198,
COMPETITION_199,
COMPETITION_200,
COMPETITION_201,
COMPETITION_202,
COMPETITION_203,
COMPETITION_204,
COMPETITION_205,
COMPETITION_206,
COMPETITION_207,
COMPETITION_208,
COMPETITION_209,
COMPETITION_210,
COMPETITION_211,
COMPETITION_212,
COMPETITION_213,
COMPETITION_214,
COMPETITION_215,
COMPETITION_216,
COMPETITION_217,
COMPETITION_218,
COMPETITION_219,
COMPETITION_220,
COMPETITION_221,
COMPETITION_222,
COMPETITION_223,
COMPETITION_224,
COMPETITION_225,
COMPETITION_226,
COMPETITION_227,
COMPETITION_228,
COMPETITION_229,
COMPETITION_230,
COMPETITION_231,
COMPETITION_232,
COMPETITION_233,
COMPETITION_234,
COMPETITION_235,
COMPETITION_236,
COMPETITION_237,
COMPETITION_238;
public static final String COMPETITION_PREFIX = "COMPETITION_";
public static boolean isCompetitionInput(DataEnum dataEnum) {
if (dataEnum instanceof CompetitionEnum) {
return ((CompetitionEnum) dataEnum).isCompetitionInput();
} else {
return false;
}
}
public boolean isCompetitionInput() {
return this.toString().startsWith(COMPETITION_PREFIX);
}
@Override
public ObjectSupplier getObjectSupplier() {
return switch (this) {
case COMPETITION_1 -> IntegerSerializer.fromEnum(this);
case COMPETITION_2 -> IntegerSerializer.fromEnum(this);
case COMPETITION_3 -> IntegerSerializer.fromEnum(this);
case COMPETITION_5 -> IntegerSerializer.fromEnum(this);
case COMPETITION_6 -> IntegerSerializer.fromEnum(this);
case COMPETITION_7 -> IntegerSerializer.fromEnum(this);
case COMPETITION_8 -> IntegerSerializer.fromEnum(this);
case COMPETITION_9 -> IntegerSerializer.fromEnum(this);
case COMPETITION_10 -> IntegerSerializer.fromEnum(this);
case COMPETITION_11 -> IntegerSerializer.fromEnum(this);
case COMPETITION_12 -> IntegerSerializer.fromEnum(this);
case COMPETITION_13 -> IntegerSerializer.fromEnum(this);
case COMPETITION_15 -> IntegerSerializer.fromEnum(this);
case COMPETITION_16 -> IntegerSerializer.fromEnum(this);
case COMPETITION_17 -> IntegerSerializer.fromEnum(this);
case COMPETITION_18 -> IntegerSerializer.fromEnum(this);
case COMPETITION_19 -> IntegerSerializer.fromEnum(this);
case COMPETITION_20 -> IntegerSerializer.fromEnum(this);
case COMPETITION_21 -> IntegerSerializer.fromEnum(this);
case COMPETITION_22 -> IntegerSerializer.fromEnum(this);
case COMPETITION_23 -> IntegerSerializer.fromEnum(this);
case COMPETITION_24 -> IntegerSerializer.fromEnum(this);
case COMPETITION_25 -> IntegerSerializer.fromEnum(this);
case COMPETITION_26 -> IntegerSerializer.fromEnum(this);
case COMPETITION_27 -> IntegerSerializer.fromEnum(this);
case COMPETITION_28 -> IntegerSerializer.fromEnum(this);
case COMPETITION_29 -> IntegerSerializer.fromEnum(this);
case COMPETITION_30 -> IntegerSerializer.fromEnum(this);
case COMPETITION_31 -> IntegerSerializer.fromEnum(this);
case COMPETITION_32 -> IntegerSerializer.fromEnum(this);
case COMPETITION_33 -> IntegerSerializer.fromEnum(this);
case COMPETITION_34 -> IntegerSerializer.fromEnum(this);
case COMPETITION_35 -> IntegerSerializer.fromEnum(this);
case COMPETITION_36 -> IntegerSerializer.fromEnum(this);
case COMPETITION_37 -> IntegerSerializer.fromEnum(this);
case COMPETITION_38 -> IntegerSerializer.fromEnum(this);
case COMPETITION_39 -> IntegerSerializer.fromEnum(this);
case COMPETITION_40 -> IntegerSerializer.fromEnum(this);
case COMPETITION_41 -> IntegerSerializer.fromEnum(this);
case COMPETITION_42 -> IntegerSerializer.fromEnum(this);
case COMPETITION_43 -> IntegerSerializer.fromEnum(this);
case COMPETITION_44 -> IntegerSerializer.fromEnum(this);
case COMPETITION_45 -> IntegerSerializer.fromEnum(this);
case COMPETITION_46 -> IntegerSerializer.fromEnum(this);
case COMPETITION_47 -> IntegerSerializer.fromEnum(this);
case COMPETITION_48 -> IntegerSerializer.fromEnum(this);
case COMPETITION_49 -> IntegerSerializer.fromEnum(this);
case COMPETITION_50 -> IntegerSerializer.fromEnum(this);
case COMPETITION_51 -> IntegerSerializer.fromEnum(this);
case COMPETITION_52 -> IntegerSerializer.fromEnum(this);
case COMPETITION_53 -> IntegerSerializer.fromEnum(this);
case COMPETITION_54 -> IntegerSerializer.fromEnum(this);
case COMPETITION_55 -> IntegerSerializer.fromEnum(this);
case COMPETITION_56 -> IntegerSerializer.fromEnum(this);
case COMPETITION_57 -> IntegerSerializer.fromEnum(this);
case COMPETITION_58 -> IntegerSerializer.fromEnum(this);
case COMPETITION_59 -> IntegerSerializer.fromEnum(this);
case COMPETITION_60 -> IntegerSerializer.fromEnum(this);
case COMPETITION_61 -> IntegerSerializer.fromEnum(this);
case COMPETITION_62 -> IntegerSerializer.fromEnum(this);
case COMPETITION_63 -> IntegerSerializer.fromEnum(this);
case COMPETITION_64 -> IntegerSerializer.fromEnum(this);
case COMPETITION_65 -> IntegerSerializer.fromEnum(this);
case COMPETITION_66 -> IntegerSerializer.fromEnum(this);
case COMPETITION_67 -> IntegerSerializer.fromEnum(this);
case COMPETITION_68 -> IntegerSerializer.fromEnum(this);
case COMPETITION_69 -> IntegerSerializer.fromEnum(this);
case COMPETITION_70 -> IntegerSerializer.fromEnum(this);
case COMPETITION_71 -> IntegerSerializer.fromEnum(this);
case COMPETITION_72 -> IntegerSerializer.fromEnum(this);
case COMPETITION_73 -> IntegerSerializer.fromEnum(this);
case COMPETITION_74 -> IntegerSerializer.fromEnum(this);
case COMPETITION_75 -> IntegerSerializer.fromEnum(this);
case COMPETITION_76 -> IntegerSerializer.fromEnum(this);
case COMPETITION_77 -> IntegerSerializer.fromEnum(this);
case COMPETITION_78 -> IntegerSerializer.fromEnum(this);
case COMPETITION_79 -> IntegerSerializer.fromEnum(this);
case COMPETITION_80 -> IntegerSerializer.fromEnum(this);
case COMPETITION_81 -> IntegerSerializer.fromEnum(this);
case COMPETITION_82 -> IntegerSerializer.fromEnum(this);
case COMPETITION_83 -> IntegerSerializer.fromEnum(this);
case COMPETITION_84 -> IntegerSerializer.fromEnum(this);
case COMPETITION_85 -> IntegerSerializer.fromEnum(this);
case COMPETITION_86 -> IntegerSerializer.fromEnum(this);
case COMPETITION_87 -> IntegerSerializer.fromEnum(this);
case COMPETITION_88 -> IntegerSerializer.fromEnum(this);
case COMPETITION_89 -> IntegerSerializer.fromEnum(this);
case COMPETITION_90 -> IntegerSerializer.fromEnum(this);
case COMPETITION_91 -> IntegerSerializer.fromEnum(this);
case COMPETITION_92 -> IntegerSerializer.fromEnum(this);
case COMPETITION_93 -> IntegerSerializer.fromEnum(this);
case COMPETITION_94 -> IntegerSerializer.fromEnum(this);
case COMPETITION_95 -> IntegerSerializer.fromEnum(this);
case COMPETITION_96 -> IntegerSerializer.fromEnum(this);
case COMPETITION_97 -> IntegerSerializer.fromEnum(this);
case COMPETITION_99 -> IntegerSerializer.fromEnum(this);
case COMPETITION_100 -> IntegerSerializer.fromEnum(this);
case COMPETITION_101 -> IntegerSerializer.fromEnum(this);
case COMPETITION_102 -> IntegerSerializer.fromEnum(this);
case COMPETITION_103 -> IntegerSerializer.fromEnum(this);
case COMPETITION_104 -> IntegerSerializer.fromEnum(this);
case COMPETITION_105 -> IntegerSerializer.fromEnum(this);
case COMPETITION_106 -> IntegerSerializer.fromEnum(this);
case COMPETITION_107 -> IntegerSerializer.fromEnum(this);
case COMPETITION_108 -> IntegerSerializer.fromEnum(this);
case COMPETITION_109 -> IntegerSerializer.fromEnum(this);
case COMPETITION_110 -> IntegerSerializer.fromEnum(this);
case COMPETITION_111 -> IntegerSerializer.fromEnum(this);
case COMPETITION_112 -> IntegerSerializer.fromEnum(this);
case COMPETITION_113 -> IntegerSerializer.fromEnum(this);
case COMPETITION_114 -> IntegerSerializer.fromEnum(this);
case COMPETITION_115 -> IntegerSerializer.fromEnum(this);
case COMPETITION_116 -> IntegerSerializer.fromEnum(this);
case COMPETITION_117 -> IntegerSerializer.fromEnum(this);
case COMPETITION_118 -> IntegerSerializer.fromEnum(this);
case COMPETITION_119 -> IntegerSerializer.fromEnum(this);
case COMPETITION_120 -> IntegerSerializer.fromEnum(this);
case COMPETITION_121 -> IntegerSerializer.fromEnum(this);
case COMPETITION_122 -> IntegerSerializer.fromEnum(this);
case COMPETITION_123 -> IntegerSerializer.fromEnum(this);
case COMPETITION_124 -> IntegerSerializer.fromEnum(this);
case COMPETITION_125 -> IntegerSerializer.fromEnum(this);
case COMPETITION_126 -> IntegerSerializer.fromEnum(this);
case COMPETITION_127 -> IntegerSerializer.fromEnum(this);
case COMPETITION_128 -> IntegerSerializer.fromEnum(this);
case COMPETITION_129 -> IntegerSerializer.fromEnum(this);
case COMPETITION_130 -> IntegerSerializer.fromEnum(this);
case COMPETITION_131 -> IntegerSerializer.fromEnum(this);
case COMPETITION_132 -> IntegerSerializer.fromEnum(this);
case COMPETITION_133 -> IntegerSerializer.fromEnum(this);
case COMPETITION_134 -> IntegerSerializer.fromEnum(this);
case COMPETITION_135 -> IntegerSerializer.fromEnum(this);
case COMPETITION_136 -> IntegerSerializer.fromEnum(this);
case COMPETITION_137 -> IntegerSerializer.fromEnum(this);
case COMPETITION_138 -> IntegerSerializer.fromEnum(this);
case COMPETITION_139 -> IntegerSerializer.fromEnum(this);
case COMPETITION_140 -> IntegerSerializer.fromEnum(this);
case COMPETITION_141 -> IntegerSerializer.fromEnum(this);
case COMPETITION_142 -> IntegerSerializer.fromEnum(this);
case COMPETITION_143 -> IntegerSerializer.fromEnum(this);
case COMPETITION_144 -> IntegerSerializer.fromEnum(this);
case COMPETITION_145 -> IntegerSerializer.fromEnum(this);
case COMPETITION_146 -> IntegerSerializer.fromEnum(this);
case COMPETITION_147 -> IntegerSerializer.fromEnum(this);
case COMPETITION_148 -> IntegerSerializer.fromEnum(this);
case COMPETITION_149 -> IntegerSerializer.fromEnum(this);
case COMPETITION_150 -> IntegerSerializer.fromEnum(this);
case COMPETITION_151 -> IntegerSerializer.fromEnum(this);
case COMPETITION_152 -> IntegerSerializer.fromEnum(this);
case COMPETITION_153 -> IntegerSerializer.fromEnum(this);
case COMPETITION_154 -> IntegerSerializer.fromEnum(this);
case COMPETITION_155 -> IntegerSerializer.fromEnum(this);
case COMPETITION_156 -> IntegerSerializer.fromEnum(this);
case COMPETITION_157 -> IntegerSerializer.fromEnum(this);
case COMPETITION_158 -> IntegerSerializer.fromEnum(this);
case COMPETITION_159 -> IntegerSerializer.fromEnum(this);
case COMPETITION_160 -> IntegerSerializer.fromEnum(this);
case COMPETITION_161 -> IntegerSerializer.fromEnum(this);
case COMPETITION_162 -> IntegerSerializer.fromEnum(this);
case COMPETITION_163 -> IntegerSerializer.fromEnum(this);
case COMPETITION_164 -> IntegerSerializer.fromEnum(this);
case COMPETITION_165 -> IntegerSerializer.fromEnum(this);
case COMPETITION_166 -> IntegerSerializer.fromEnum(this);
case COMPETITION_167 -> IntegerSerializer.fromEnum(this);
case COMPETITION_168 -> IntegerSerializer.fromEnum(this);
case COMPETITION_169 -> IntegerSerializer.fromEnum(this);
case COMPETITION_170 -> IntegerSerializer.fromEnum(this);
case COMPETITION_171 -> IntegerSerializer.fromEnum(this);
case COMPETITION_172 -> IntegerSerializer.fromEnum(this);
case COMPETITION_173 -> IntegerSerializer.fromEnum(this);
case COMPETITION_174 -> IntegerSerializer.fromEnum(this);
case COMPETITION_175 -> IntegerSerializer.fromEnum(this);
case COMPETITION_176 -> IntegerSerializer.fromEnum(this);
case COMPETITION_177 -> IntegerSerializer.fromEnum(this);
case COMPETITION_178 -> IntegerSerializer.fromEnum(this);
case COMPETITION_179 -> IntegerSerializer.fromEnum(this);
case COMPETITION_180 -> IntegerSerializer.fromEnum(this);
case COMPETITION_181 -> IntegerSerializer.fromEnum(this);
case COMPETITION_182 -> IntegerSerializer.fromEnum(this);
case COMPETITION_183 -> IntegerSerializer.fromEnum(this);
case COMPETITION_184 -> IntegerSerializer.fromEnum(this);
case COMPETITION_185 -> IntegerSerializer.fromEnum(this);
case COMPETITION_186 -> IntegerSerializer.fromEnum(this);
case COMPETITION_187 -> IntegerSerializer.fromEnum(this);
case COMPETITION_188 -> IntegerSerializer.fromEnum(this);
case COMPETITION_189 -> IntegerSerializer.fromEnum(this);
case COMPETITION_190 -> IntegerSerializer.fromEnum(this);
case COMPETITION_191 -> IntegerSerializer.fromEnum(this);
case COMPETITION_192 -> IntegerSerializer.fromEnum(this);
case COMPETITION_193 -> IntegerSerializer.fromEnum(this);
case COMPETITION_194 -> IntegerSerializer.fromEnum(this);
case COMPETITION_195 -> IntegerSerializer.fromEnum(this);
case COMPETITION_196 -> IntegerSerializer.fromEnum(this);
case COMPETITION_197 -> IntegerSerializer.fromEnum(this);
case COMPETITION_198 -> IntegerSerializer.fromEnum(this);
case COMPETITION_199 -> IntegerSerializer.fromEnum(this);
case COMPETITION_200 -> IntegerSerializer.fromEnum(this);
case COMPETITION_201 -> IntegerSerializer.fromEnum(this);
case COMPETITION_202 -> IntegerSerializer.fromEnum(this);
case COMPETITION_203 -> IntegerSerializer.fromEnum(this);
case COMPETITION_204 -> IntegerSerializer.fromEnum(this);
case COMPETITION_205 -> IntegerSerializer.fromEnum(this);
case COMPETITION_206 -> IntegerSerializer.fromEnum(this);
case COMPETITION_207 -> IntegerSerializer.fromEnum(this);
case COMPETITION_208 -> IntegerSerializer.fromEnum(this);
case COMPETITION_209 -> IntegerSerializer.fromEnum(this);
case COMPETITION_210 -> IntegerSerializer.fromEnum(this);
case COMPETITION_211 -> IntegerSerializer.fromEnum(this);
case COMPETITION_212 -> IntegerSerializer.fromEnum(this);
case COMPETITION_213 -> IntegerSerializer.fromEnum(this);
case COMPETITION_214 -> IntegerSerializer.fromEnum(this);
case COMPETITION_215 -> IntegerSerializer.fromEnum(this);
case COMPETITION_216 -> IntegerSerializer.fromEnum(this);
case COMPETITION_217 -> IntegerSerializer.fromEnum(this);
case COMPETITION_218 -> IntegerSerializer.fromEnum(this);
case COMPETITION_219 -> IntegerSerializer.fromEnum(this);
case COMPETITION_220 -> IntegerSerializer.fromEnum(this);
case COMPETITION_221 -> IntegerSerializer.fromEnum(this);
case COMPETITION_222 -> IntegerSerializer.fromEnum(this);
case COMPETITION_223 -> IntegerSerializer.fromEnum(this);
case COMPETITION_224 -> IntegerSerializer.fromEnum(this);
case COMPETITION_225 -> IntegerSerializer.fromEnum(this);
case COMPETITION_226 -> IntegerSerializer.fromEnum(this);
case COMPETITION_227 -> IntegerSerializer.fromEnum(this);
case COMPETITION_228 -> IntegerSerializer.fromEnum(this);
case COMPETITION_229 -> IntegerSerializer.fromEnum(this);
case COMPETITION_230 -> IntegerSerializer.fromEnum(this);
case COMPETITION_231 -> IntegerSerializer.fromEnum(this);
case COMPETITION_232 -> IntegerSerializer.fromEnum(this);
case COMPETITION_233 -> IntegerSerializer.fromEnum(this);
case COMPETITION_234 -> IntegerSerializer.fromEnum(this);
case COMPETITION_235 -> IntegerSerializer.fromEnum(this);
case COMPETITION_236 -> IntegerSerializer.fromEnum(this);
case COMPETITION_237 -> IntegerSerializer.fromEnum(this);
case COMPETITION_238 -> IntegerSerializer.fromEnum(this);
};
}
}

View File

@ -1,510 +1,8 @@
package de.uni_marburg.powersort.data; package de.uni_marburg.powersort.data;
public enum DataEnum { /**
RANDOM_INTEGERS_300M, * Interface for generic usage of different concrete Enum classes.
ASCENDING_INTEGERS_300M, */
DESCENDING_INTEGERS_250M, public interface DataEnum {
ASCENDING_RUNS_1M, ObjectSupplier getObjectSupplier();
ASCENDING_RUNS_WITH_OVERLAP_1M,
COMPETITION_1,
COMPETITION_2,
COMPETITION_3,
// COMPETITION_4, // Invalid input file.
COMPETITION_5,
COMPETITION_6,
COMPETITION_7,
COMPETITION_8,
COMPETITION_9,
COMPETITION_10,
COMPETITION_11,
COMPETITION_12,
COMPETITION_13,
// COMPETITION_14, // Invalid input file.
COMPETITION_15,
COMPETITION_16,
COMPETITION_17,
COMPETITION_18,
COMPETITION_19,
COMPETITION_20,
COMPETITION_21,
COMPETITION_22,
COMPETITION_23,
COMPETITION_24,
COMPETITION_25,
COMPETITION_26,
COMPETITION_27,
COMPETITION_28,
COMPETITION_29,
COMPETITION_30,
COMPETITION_31,
COMPETITION_32,
COMPETITION_33,
COMPETITION_34,
COMPETITION_35,
COMPETITION_36,
COMPETITION_37,
COMPETITION_38,
COMPETITION_39,
COMPETITION_40,
COMPETITION_41,
COMPETITION_42,
COMPETITION_43,
COMPETITION_44,
COMPETITION_45,
COMPETITION_46,
COMPETITION_47,
COMPETITION_48,
COMPETITION_49,
COMPETITION_50,
COMPETITION_51,
COMPETITION_52,
COMPETITION_53,
COMPETITION_54,
COMPETITION_55,
COMPETITION_56,
COMPETITION_57,
COMPETITION_58,
COMPETITION_59,
COMPETITION_60,
COMPETITION_61,
COMPETITION_62,
COMPETITION_63,
COMPETITION_64,
COMPETITION_65,
COMPETITION_66,
COMPETITION_67,
COMPETITION_68,
COMPETITION_69,
COMPETITION_70,
COMPETITION_71,
COMPETITION_72,
COMPETITION_73,
COMPETITION_74,
COMPETITION_75,
COMPETITION_76,
COMPETITION_77,
COMPETITION_78,
COMPETITION_79,
COMPETITION_80,
COMPETITION_81,
COMPETITION_82,
COMPETITION_83,
COMPETITION_84,
COMPETITION_85,
COMPETITION_86,
COMPETITION_87,
COMPETITION_88,
COMPETITION_89,
COMPETITION_90,
COMPETITION_91,
COMPETITION_92,
COMPETITION_93,
COMPETITION_94,
COMPETITION_95,
COMPETITION_96,
COMPETITION_97,
// COMPETITION_98, // Invalid input file (floats not integers).
COMPETITION_99,
COMPETITION_100,
COMPETITION_101,
COMPETITION_102,
COMPETITION_103,
COMPETITION_104,
COMPETITION_105,
COMPETITION_106,
COMPETITION_107,
COMPETITION_108,
COMPETITION_109,
COMPETITION_110,
COMPETITION_111,
COMPETITION_112,
COMPETITION_113,
COMPETITION_114,
COMPETITION_115,
COMPETITION_116,
COMPETITION_117,
COMPETITION_118,
COMPETITION_119,
COMPETITION_120,
COMPETITION_121,
COMPETITION_122,
COMPETITION_123,
COMPETITION_124,
COMPETITION_125,
COMPETITION_126,
COMPETITION_127,
COMPETITION_128,
COMPETITION_129,
COMPETITION_130,
COMPETITION_131,
COMPETITION_132,
COMPETITION_133,
COMPETITION_134,
COMPETITION_135,
COMPETITION_136,
COMPETITION_137,
COMPETITION_138,
COMPETITION_139,
COMPETITION_140,
COMPETITION_141,
COMPETITION_142,
COMPETITION_143,
COMPETITION_144,
COMPETITION_145,
COMPETITION_146,
COMPETITION_147,
COMPETITION_148,
COMPETITION_149,
COMPETITION_150,
COMPETITION_151,
COMPETITION_152,
COMPETITION_153,
COMPETITION_154,
COMPETITION_155,
COMPETITION_156,
COMPETITION_157,
COMPETITION_158,
COMPETITION_159,
COMPETITION_160,
COMPETITION_161,
COMPETITION_162,
COMPETITION_163,
COMPETITION_164,
COMPETITION_165,
COMPETITION_166,
COMPETITION_167,
COMPETITION_168,
COMPETITION_169,
COMPETITION_170,
COMPETITION_171,
COMPETITION_172,
COMPETITION_173,
COMPETITION_174,
COMPETITION_175,
COMPETITION_176,
COMPETITION_177,
COMPETITION_178,
COMPETITION_179,
COMPETITION_180,
COMPETITION_181,
COMPETITION_182,
COMPETITION_183,
COMPETITION_184,
COMPETITION_185,
COMPETITION_186,
COMPETITION_187,
COMPETITION_188,
COMPETITION_189,
COMPETITION_190,
COMPETITION_191,
COMPETITION_192,
COMPETITION_193,
COMPETITION_194,
COMPETITION_195,
COMPETITION_196,
COMPETITION_197,
COMPETITION_198,
COMPETITION_199,
COMPETITION_200,
COMPETITION_201,
COMPETITION_202,
COMPETITION_203,
COMPETITION_204,
COMPETITION_205,
COMPETITION_206,
COMPETITION_207,
COMPETITION_208,
COMPETITION_209,
COMPETITION_210,
COMPETITION_211,
COMPETITION_212,
COMPETITION_213,
COMPETITION_214,
COMPETITION_215,
COMPETITION_216,
COMPETITION_217,
COMPETITION_218,
COMPETITION_219,
COMPETITION_220,
COMPETITION_221,
COMPETITION_222,
COMPETITION_223,
COMPETITION_224,
COMPETITION_225,
COMPETITION_226,
COMPETITION_227,
COMPETITION_228,
COMPETITION_229,
COMPETITION_230,
COMPETITION_231,
COMPETITION_232,
COMPETITION_233,
COMPETITION_234,
COMPETITION_235,
COMPETITION_236,
COMPETITION_237,
COMPETITION_238;
public static final String COMPETITION_PREFIX = "COMPETITION_";
public boolean isCompetitionInput(){
return this.toString().startsWith(COMPETITION_PREFIX);
}
public ObjectSupplier getObjectSupplier() {
// We use a seed to get the same random list every time -> Repeatable benchmarks on same input data!
// final long seed = 3651660232967549736L; // System.nanoTime() ++ Math.random()
final long seed = 140506881906827520L; // (long) 'P' * (long) 'O' *(long) 'W' * (long) 'E' * (long) 'R' * (long) 'S' * (long) 'O' * (long) 'R' * (long) 'T';
int longListSize = 300_000_000; // Any larger: Out of Heap Space. TODO GRADLE config
int middleListSize = 250_000_000;
int runs = 1_000;
int runLength = 1_000;
return switch (this) {
case RANDOM_INTEGERS_300M -> new RandomIntegers(longListSize, seed);
case ASCENDING_INTEGERS_300M -> new AscendingIntegers(longListSize);
case DESCENDING_INTEGERS_250M -> new DescendingIntegers(middleListSize);
case ASCENDING_RUNS_1M -> AscendingRuns.newAscendingRuns(runs, runLength, -runLength);
case ASCENDING_RUNS_WITH_OVERLAP_1M ->
AscendingRuns.newAscendingRuns(runs, runLength, (int) (-0.5 * runLength));
case COMPETITION_1 -> IntegerSerializer.fromEnum(this);
case COMPETITION_2 -> IntegerSerializer.fromEnum(this);
case COMPETITION_3 -> IntegerSerializer.fromEnum(this);
case COMPETITION_5 -> IntegerSerializer.fromEnum(this);
case COMPETITION_6 -> IntegerSerializer.fromEnum(this);
case COMPETITION_7 -> IntegerSerializer.fromEnum(this);
case COMPETITION_8 -> IntegerSerializer.fromEnum(this);
case COMPETITION_9 -> IntegerSerializer.fromEnum(this);
case COMPETITION_10 -> IntegerSerializer.fromEnum(this);
case COMPETITION_11 -> IntegerSerializer.fromEnum(this);
case COMPETITION_12 -> IntegerSerializer.fromEnum(this);
case COMPETITION_13 -> IntegerSerializer.fromEnum(this);
case COMPETITION_15 -> IntegerSerializer.fromEnum(this);
case COMPETITION_16 -> IntegerSerializer.fromEnum(this);
case COMPETITION_17 -> IntegerSerializer.fromEnum(this);
case COMPETITION_18 -> IntegerSerializer.fromEnum(this);
case COMPETITION_19 -> IntegerSerializer.fromEnum(this);
case COMPETITION_20 -> IntegerSerializer.fromEnum(this);
case COMPETITION_21 -> IntegerSerializer.fromEnum(this);
case COMPETITION_22 -> IntegerSerializer.fromEnum(this);
case COMPETITION_23 -> IntegerSerializer.fromEnum(this);
case COMPETITION_24 -> IntegerSerializer.fromEnum(this);
case COMPETITION_25 -> IntegerSerializer.fromEnum(this);
case COMPETITION_26 -> IntegerSerializer.fromEnum(this);
case COMPETITION_27 -> IntegerSerializer.fromEnum(this);
case COMPETITION_28 -> IntegerSerializer.fromEnum(this);
case COMPETITION_29 -> IntegerSerializer.fromEnum(this);
case COMPETITION_30 -> IntegerSerializer.fromEnum(this);
case COMPETITION_31 -> IntegerSerializer.fromEnum(this);
case COMPETITION_32 -> IntegerSerializer.fromEnum(this);
case COMPETITION_33 -> IntegerSerializer.fromEnum(this);
case COMPETITION_34 -> IntegerSerializer.fromEnum(this);
case COMPETITION_35 -> IntegerSerializer.fromEnum(this);
case COMPETITION_36 -> IntegerSerializer.fromEnum(this);
case COMPETITION_37 -> IntegerSerializer.fromEnum(this);
case COMPETITION_38 -> IntegerSerializer.fromEnum(this);
case COMPETITION_39 -> IntegerSerializer.fromEnum(this);
case COMPETITION_40 -> IntegerSerializer.fromEnum(this);
case COMPETITION_41 -> IntegerSerializer.fromEnum(this);
case COMPETITION_42 -> IntegerSerializer.fromEnum(this);
case COMPETITION_43 -> IntegerSerializer.fromEnum(this);
case COMPETITION_44 -> IntegerSerializer.fromEnum(this);
case COMPETITION_45 -> IntegerSerializer.fromEnum(this);
case COMPETITION_46 -> IntegerSerializer.fromEnum(this);
case COMPETITION_47 -> IntegerSerializer.fromEnum(this);
case COMPETITION_48 -> IntegerSerializer.fromEnum(this);
case COMPETITION_49 -> IntegerSerializer.fromEnum(this);
case COMPETITION_50 -> IntegerSerializer.fromEnum(this);
case COMPETITION_51 -> IntegerSerializer.fromEnum(this);
case COMPETITION_52 -> IntegerSerializer.fromEnum(this);
case COMPETITION_53 -> IntegerSerializer.fromEnum(this);
case COMPETITION_54 -> IntegerSerializer.fromEnum(this);
case COMPETITION_55 -> IntegerSerializer.fromEnum(this);
case COMPETITION_56 -> IntegerSerializer.fromEnum(this);
case COMPETITION_57 -> IntegerSerializer.fromEnum(this);
case COMPETITION_58 -> IntegerSerializer.fromEnum(this);
case COMPETITION_59 -> IntegerSerializer.fromEnum(this);
case COMPETITION_60 -> IntegerSerializer.fromEnum(this);
case COMPETITION_61 -> IntegerSerializer.fromEnum(this);
case COMPETITION_62 -> IntegerSerializer.fromEnum(this);
case COMPETITION_63 -> IntegerSerializer.fromEnum(this);
case COMPETITION_64 -> IntegerSerializer.fromEnum(this);
case COMPETITION_65 -> IntegerSerializer.fromEnum(this);
case COMPETITION_66 -> IntegerSerializer.fromEnum(this);
case COMPETITION_67 -> IntegerSerializer.fromEnum(this);
case COMPETITION_68 -> IntegerSerializer.fromEnum(this);
case COMPETITION_69 -> IntegerSerializer.fromEnum(this);
case COMPETITION_70 -> IntegerSerializer.fromEnum(this);
case COMPETITION_71 -> IntegerSerializer.fromEnum(this);
case COMPETITION_72 -> IntegerSerializer.fromEnum(this);
case COMPETITION_73 -> IntegerSerializer.fromEnum(this);
case COMPETITION_74 -> IntegerSerializer.fromEnum(this);
case COMPETITION_75 -> IntegerSerializer.fromEnum(this);
case COMPETITION_76 -> IntegerSerializer.fromEnum(this);
case COMPETITION_77 -> IntegerSerializer.fromEnum(this);
case COMPETITION_78 -> IntegerSerializer.fromEnum(this);
case COMPETITION_79 -> IntegerSerializer.fromEnum(this);
case COMPETITION_80 -> IntegerSerializer.fromEnum(this);
case COMPETITION_81 -> IntegerSerializer.fromEnum(this);
case COMPETITION_82 -> IntegerSerializer.fromEnum(this);
case COMPETITION_83 -> IntegerSerializer.fromEnum(this);
case COMPETITION_84 -> IntegerSerializer.fromEnum(this);
case COMPETITION_85 -> IntegerSerializer.fromEnum(this);
case COMPETITION_86 -> IntegerSerializer.fromEnum(this);
case COMPETITION_87 -> IntegerSerializer.fromEnum(this);
case COMPETITION_88 -> IntegerSerializer.fromEnum(this);
case COMPETITION_89 -> IntegerSerializer.fromEnum(this);
case COMPETITION_90 -> IntegerSerializer.fromEnum(this);
case COMPETITION_91 -> IntegerSerializer.fromEnum(this);
case COMPETITION_92 -> IntegerSerializer.fromEnum(this);
case COMPETITION_93 -> IntegerSerializer.fromEnum(this);
case COMPETITION_94 -> IntegerSerializer.fromEnum(this);
case COMPETITION_95 -> IntegerSerializer.fromEnum(this);
case COMPETITION_96 -> IntegerSerializer.fromEnum(this);
case COMPETITION_97 -> IntegerSerializer.fromEnum(this);
case COMPETITION_99 -> IntegerSerializer.fromEnum(this);
case COMPETITION_100 -> IntegerSerializer.fromEnum(this);
case COMPETITION_101 -> IntegerSerializer.fromEnum(this);
case COMPETITION_102 -> IntegerSerializer.fromEnum(this);
case COMPETITION_103 -> IntegerSerializer.fromEnum(this);
case COMPETITION_104 -> IntegerSerializer.fromEnum(this);
case COMPETITION_105 -> IntegerSerializer.fromEnum(this);
case COMPETITION_106 -> IntegerSerializer.fromEnum(this);
case COMPETITION_107 -> IntegerSerializer.fromEnum(this);
case COMPETITION_108 -> IntegerSerializer.fromEnum(this);
case COMPETITION_109 -> IntegerSerializer.fromEnum(this);
case COMPETITION_110 -> IntegerSerializer.fromEnum(this);
case COMPETITION_111 -> IntegerSerializer.fromEnum(this);
case COMPETITION_112 -> IntegerSerializer.fromEnum(this);
case COMPETITION_113 -> IntegerSerializer.fromEnum(this);
case COMPETITION_114 -> IntegerSerializer.fromEnum(this);
case COMPETITION_115 -> IntegerSerializer.fromEnum(this);
case COMPETITION_116 -> IntegerSerializer.fromEnum(this);
case COMPETITION_117 -> IntegerSerializer.fromEnum(this);
case COMPETITION_118 -> IntegerSerializer.fromEnum(this);
case COMPETITION_119 -> IntegerSerializer.fromEnum(this);
case COMPETITION_120 -> IntegerSerializer.fromEnum(this);
case COMPETITION_121 -> IntegerSerializer.fromEnum(this);
case COMPETITION_122 -> IntegerSerializer.fromEnum(this);
case COMPETITION_123 -> IntegerSerializer.fromEnum(this);
case COMPETITION_124 -> IntegerSerializer.fromEnum(this);
case COMPETITION_125 -> IntegerSerializer.fromEnum(this);
case COMPETITION_126 -> IntegerSerializer.fromEnum(this);
case COMPETITION_127 -> IntegerSerializer.fromEnum(this);
case COMPETITION_128 -> IntegerSerializer.fromEnum(this);
case COMPETITION_129 -> IntegerSerializer.fromEnum(this);
case COMPETITION_130 -> IntegerSerializer.fromEnum(this);
case COMPETITION_131 -> IntegerSerializer.fromEnum(this);
case COMPETITION_132 -> IntegerSerializer.fromEnum(this);
case COMPETITION_133 -> IntegerSerializer.fromEnum(this);
case COMPETITION_134 -> IntegerSerializer.fromEnum(this);
case COMPETITION_135 -> IntegerSerializer.fromEnum(this);
case COMPETITION_136 -> IntegerSerializer.fromEnum(this);
case COMPETITION_137 -> IntegerSerializer.fromEnum(this);
case COMPETITION_138 -> IntegerSerializer.fromEnum(this);
case COMPETITION_139 -> IntegerSerializer.fromEnum(this);
case COMPETITION_140 -> IntegerSerializer.fromEnum(this);
case COMPETITION_141 -> IntegerSerializer.fromEnum(this);
case COMPETITION_142 -> IntegerSerializer.fromEnum(this);
case COMPETITION_143 -> IntegerSerializer.fromEnum(this);
case COMPETITION_144 -> IntegerSerializer.fromEnum(this);
case COMPETITION_145 -> IntegerSerializer.fromEnum(this);
case COMPETITION_146 -> IntegerSerializer.fromEnum(this);
case COMPETITION_147 -> IntegerSerializer.fromEnum(this);
case COMPETITION_148 -> IntegerSerializer.fromEnum(this);
case COMPETITION_149 -> IntegerSerializer.fromEnum(this);
case COMPETITION_150 -> IntegerSerializer.fromEnum(this);
case COMPETITION_151 -> IntegerSerializer.fromEnum(this);
case COMPETITION_152 -> IntegerSerializer.fromEnum(this);
case COMPETITION_153 -> IntegerSerializer.fromEnum(this);
case COMPETITION_154 -> IntegerSerializer.fromEnum(this);
case COMPETITION_155 -> IntegerSerializer.fromEnum(this);
case COMPETITION_156 -> IntegerSerializer.fromEnum(this);
case COMPETITION_157 -> IntegerSerializer.fromEnum(this);
case COMPETITION_158 -> IntegerSerializer.fromEnum(this);
case COMPETITION_159 -> IntegerSerializer.fromEnum(this);
case COMPETITION_160 -> IntegerSerializer.fromEnum(this);
case COMPETITION_161 -> IntegerSerializer.fromEnum(this);
case COMPETITION_162 -> IntegerSerializer.fromEnum(this);
case COMPETITION_163 -> IntegerSerializer.fromEnum(this);
case COMPETITION_164 -> IntegerSerializer.fromEnum(this);
case COMPETITION_165 -> IntegerSerializer.fromEnum(this);
case COMPETITION_166 -> IntegerSerializer.fromEnum(this);
case COMPETITION_167 -> IntegerSerializer.fromEnum(this);
case COMPETITION_168 -> IntegerSerializer.fromEnum(this);
case COMPETITION_169 -> IntegerSerializer.fromEnum(this);
case COMPETITION_170 -> IntegerSerializer.fromEnum(this);
case COMPETITION_171 -> IntegerSerializer.fromEnum(this);
case COMPETITION_172 -> IntegerSerializer.fromEnum(this);
case COMPETITION_173 -> IntegerSerializer.fromEnum(this);
case COMPETITION_174 -> IntegerSerializer.fromEnum(this);
case COMPETITION_175 -> IntegerSerializer.fromEnum(this);
case COMPETITION_176 -> IntegerSerializer.fromEnum(this);
case COMPETITION_177 -> IntegerSerializer.fromEnum(this);
case COMPETITION_178 -> IntegerSerializer.fromEnum(this);
case COMPETITION_179 -> IntegerSerializer.fromEnum(this);
case COMPETITION_180 -> IntegerSerializer.fromEnum(this);
case COMPETITION_181 -> IntegerSerializer.fromEnum(this);
case COMPETITION_182 -> IntegerSerializer.fromEnum(this);
case COMPETITION_183 -> IntegerSerializer.fromEnum(this);
case COMPETITION_184 -> IntegerSerializer.fromEnum(this);
case COMPETITION_185 -> IntegerSerializer.fromEnum(this);
case COMPETITION_186 -> IntegerSerializer.fromEnum(this);
case COMPETITION_187 -> IntegerSerializer.fromEnum(this);
case COMPETITION_188 -> IntegerSerializer.fromEnum(this);
case COMPETITION_189 -> IntegerSerializer.fromEnum(this);
case COMPETITION_190 -> IntegerSerializer.fromEnum(this);
case COMPETITION_191 -> IntegerSerializer.fromEnum(this);
case COMPETITION_192 -> IntegerSerializer.fromEnum(this);
case COMPETITION_193 -> IntegerSerializer.fromEnum(this);
case COMPETITION_194 -> IntegerSerializer.fromEnum(this);
case COMPETITION_195 -> IntegerSerializer.fromEnum(this);
case COMPETITION_196 -> IntegerSerializer.fromEnum(this);
case COMPETITION_197 -> IntegerSerializer.fromEnum(this);
case COMPETITION_198 -> IntegerSerializer.fromEnum(this);
case COMPETITION_199 -> IntegerSerializer.fromEnum(this);
case COMPETITION_200 -> IntegerSerializer.fromEnum(this);
case COMPETITION_201 -> IntegerSerializer.fromEnum(this);
case COMPETITION_202 -> IntegerSerializer.fromEnum(this);
case COMPETITION_203 -> IntegerSerializer.fromEnum(this);
case COMPETITION_204 -> IntegerSerializer.fromEnum(this);
case COMPETITION_205 -> IntegerSerializer.fromEnum(this);
case COMPETITION_206 -> IntegerSerializer.fromEnum(this);
case COMPETITION_207 -> IntegerSerializer.fromEnum(this);
case COMPETITION_208 -> IntegerSerializer.fromEnum(this);
case COMPETITION_209 -> IntegerSerializer.fromEnum(this);
case COMPETITION_210 -> IntegerSerializer.fromEnum(this);
case COMPETITION_211 -> IntegerSerializer.fromEnum(this);
case COMPETITION_212 -> IntegerSerializer.fromEnum(this);
case COMPETITION_213 -> IntegerSerializer.fromEnum(this);
case COMPETITION_214 -> IntegerSerializer.fromEnum(this);
case COMPETITION_215 -> IntegerSerializer.fromEnum(this);
case COMPETITION_216 -> IntegerSerializer.fromEnum(this);
case COMPETITION_217 -> IntegerSerializer.fromEnum(this);
case COMPETITION_218 -> IntegerSerializer.fromEnum(this);
case COMPETITION_219 -> IntegerSerializer.fromEnum(this);
case COMPETITION_220 -> IntegerSerializer.fromEnum(this);
case COMPETITION_221 -> IntegerSerializer.fromEnum(this);
case COMPETITION_222 -> IntegerSerializer.fromEnum(this);
case COMPETITION_223 -> IntegerSerializer.fromEnum(this);
case COMPETITION_224 -> IntegerSerializer.fromEnum(this);
case COMPETITION_225 -> IntegerSerializer.fromEnum(this);
case COMPETITION_226 -> IntegerSerializer.fromEnum(this);
case COMPETITION_227 -> IntegerSerializer.fromEnum(this);
case COMPETITION_228 -> IntegerSerializer.fromEnum(this);
case COMPETITION_229 -> IntegerSerializer.fromEnum(this);
case COMPETITION_230 -> IntegerSerializer.fromEnum(this);
case COMPETITION_231 -> IntegerSerializer.fromEnum(this);
case COMPETITION_232 -> IntegerSerializer.fromEnum(this);
case COMPETITION_233 -> IntegerSerializer.fromEnum(this);
case COMPETITION_234 -> IntegerSerializer.fromEnum(this);
case COMPETITION_235 -> IntegerSerializer.fromEnum(this);
case COMPETITION_236 -> IntegerSerializer.fromEnum(this);
case COMPETITION_237 -> IntegerSerializer.fromEnum(this);
case COMPETITION_238 -> IntegerSerializer.fromEnum(this);
};
}
} }

View File

@ -11,13 +11,13 @@ public class IntegerSerializer {
private final int id; private final int id;
public static ObjectSupplier fromEnum(DataEnum dataEnum) { public static ObjectSupplier fromEnum(CompetitionEnum dataEnum) {
if(!dataEnum.isCompetitionInput()){ if (!dataEnum.isCompetitionInput()) {
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} }
String prefixedId = dataEnum.toString(); String prefixedId = dataEnum.toString();
IntegerSerializer serializer = new IntegerSerializer(Integer.parseInt(prefixedId.substring(DataEnum.COMPETITION_PREFIX.length()))); IntegerSerializer serializer = new IntegerSerializer(Integer.parseInt(prefixedId.substring(CompetitionEnum.COMPETITION_PREFIX.length())));
return serializer.getObjectSupplier(); return serializer.getObjectSupplier();
} }