Class GameTestsPerformanceIngredientIndex
java.lang.Object
org.cyclops.integrateddynamics.gametest.GameTestsPerformanceIngredientIndex
Performance benchmarks for
IngredientPositionsIndex.
These measure the index lookups that storage networks perform on every insertion and extraction.
This is not covered by the network tick time benchmarks in GameTestsPerformance,
as those do not contain any storage positions.
Results are written to runs/gameTestServer/logs/benchmark_results.txt for CI processing.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classAn index that is filled with a large number of instances, spread over a large number of positions. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe number of distinct instances that is indexed.static final intThe number of measured operations per benchmark.static final intThe number of positions over which the instances are spread.static final intThe number of times each benchmark is repeated, of which the median is reported.static final Stringstatic final intThe number of unmeasured operations that are executed before each benchmark, to warm up the JIT. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidbenchmark(net.minecraft.gametest.framework.GameTestHelper helper, String name, int operations, Function<GameTestsPerformanceIngredientIndex.Fixture, IntUnaryOperator> operationFactory) Run the given operation on a freshly constructed index, and append its average execution time to the benchmark results.protected static intvoidtestPerformanceIndexLookupExact(net.minecraft.gametest.framework.GameTestHelper helper) voidtestPerformanceIndexLookupItem(net.minecraft.gametest.framework.GameTestHelper helper) voidtestPerformanceIndexLookupNonEmptyAll(net.minecraft.gametest.framework.GameTestHelper helper) voidtestPerformanceIndexLookupNonEmptyFirst(net.minecraft.gametest.framework.GameTestHelper helper) voidtestPerformanceIndexModification(net.minecraft.gametest.framework.GameTestHelper helper)
-
Field Details
-
TEMPLATE_EMPTY
- See Also:
-
INSTANCES
public static final int INSTANCESThe number of distinct instances that is indexed.- See Also:
-
POSITIONS
public static final int POSITIONSThe number of positions over which the instances are spread.- See Also:
-
OPERATIONS
public static final int OPERATIONSThe number of measured operations per benchmark.- See Also:
-
WARMUP_OPERATIONS
public static final int WARMUP_OPERATIONSThe number of unmeasured operations that are executed before each benchmark, to warm up the JIT.- See Also:
-
ROUNDS
public static final int ROUNDSThe number of times each benchmark is repeated, of which the median is reported. Repeating reduces the effect of garbage collections during a single measurement.- See Also:
-
-
Constructor Details
-
GameTestsPerformanceIngredientIndex
public GameTestsPerformanceIngredientIndex()
-
-
Method Details
-
testPerformanceIndexLookupExact
public void testPerformanceIndexLookupExact(net.minecraft.gametest.framework.GameTestHelper helper) -
testPerformanceIndexLookupItem
public void testPerformanceIndexLookupItem(net.minecraft.gametest.framework.GameTestHelper helper) -
testPerformanceIndexLookupNonEmptyFirst
public void testPerformanceIndexLookupNonEmptyFirst(net.minecraft.gametest.framework.GameTestHelper helper) -
testPerformanceIndexLookupNonEmptyAll
public void testPerformanceIndexLookupNonEmptyAll(net.minecraft.gametest.framework.GameTestHelper helper) -
testPerformanceIndexModification
public void testPerformanceIndexModification(net.minecraft.gametest.framework.GameTestHelper helper) -
count
-
benchmark
protected static void benchmark(net.minecraft.gametest.framework.GameTestHelper helper, String name, int operations, Function<GameTestsPerformanceIngredientIndex.Fixture, IntUnaryOperator> operationFactory) Run the given operation on a freshly constructed index, and append its average execution time to the benchmark results.- Parameters:
helper- A game test helper.name- The benchmark name.operations- The number of measured operations.operationFactory- A factory for the operation to measure, taking an operation index.
-