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.static enumHow the indexed instances are spread over item types. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe number of distinct item types used byGameTestsPerformanceIngredientIndex.Shape.FEW_ITEMS.static final intThe number of distinct instances that is indexed.static final intOne in this many instances carries a component underGameTestsPerformanceIngredientIndex.Shape.MIXED.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 voidbenchmark(net.minecraft.gametest.framework.GameTestHelper helper, String name, int operations, GameTestsPerformanceIngredientIndex.Shape shape, Function<GameTestsPerformanceIngredientIndex.Fixture, IntUnaryOperator> operationFactory) protected static intvoidtestPerformanceIndexLookupExact(net.minecraft.gametest.framework.GameTestHelper helper) voidtestPerformanceIndexLookupExactFewItems(net.minecraft.gametest.framework.GameTestHelper helper) voidtestPerformanceIndexLookupExactHeavyComponents(net.minecraft.gametest.framework.GameTestHelper helper) voidtestPerformanceIndexLookupExactMixed(net.minecraft.gametest.framework.GameTestHelper helper) voidtestPerformanceIndexLookupExactPlain(net.minecraft.gametest.framework.GameTestHelper helper) voidtestPerformanceIndexLookupExactSingleItem(net.minecraft.gametest.framework.GameTestHelper helper) voidtestPerformanceIndexLookupItem(net.minecraft.gametest.framework.GameTestHelper helper) voidtestPerformanceIndexLookupItemMixed(net.minecraft.gametest.framework.GameTestHelper helper) voidtestPerformanceIndexLookupItemPlain(net.minecraft.gametest.framework.GameTestHelper helper) voidtestPerformanceIndexLookupItemSingleItem(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) voidtestPerformanceIndexModificationFewItems(net.minecraft.gametest.framework.GameTestHelper helper) voidtestPerformanceIndexModificationHeavyComponents(net.minecraft.gametest.framework.GameTestHelper helper) voidtestPerformanceIndexModificationMixed(net.minecraft.gametest.framework.GameTestHelper helper) voidtestPerformanceIndexModificationPlain(net.minecraft.gametest.framework.GameTestHelper helper) voidtestPerformanceIndexModificationSingleItem(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:
-
FEW_ITEMS_COUNT
public static final int FEW_ITEMS_COUNTThe number of distinct item types used byGameTestsPerformanceIngredientIndex.Shape.FEW_ITEMS.- See Also:
-
MIXED_COMPONENT_FRACTION
public static final int MIXED_COMPONENT_FRACTIONOne in this many instances carries a component underGameTestsPerformanceIngredientIndex.Shape.MIXED.- 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) -
testPerformanceIndexLookupExactSingleItem
public void testPerformanceIndexLookupExactSingleItem(net.minecraft.gametest.framework.GameTestHelper helper) -
testPerformanceIndexModificationSingleItem
public void testPerformanceIndexModificationSingleItem(net.minecraft.gametest.framework.GameTestHelper helper) -
testPerformanceIndexLookupExactFewItems
public void testPerformanceIndexLookupExactFewItems(net.minecraft.gametest.framework.GameTestHelper helper) -
testPerformanceIndexModificationFewItems
public void testPerformanceIndexModificationFewItems(net.minecraft.gametest.framework.GameTestHelper helper) -
testPerformanceIndexLookupExactHeavyComponents
public void testPerformanceIndexLookupExactHeavyComponents(net.minecraft.gametest.framework.GameTestHelper helper) -
testPerformanceIndexModificationHeavyComponents
public void testPerformanceIndexModificationHeavyComponents(net.minecraft.gametest.framework.GameTestHelper helper) -
testPerformanceIndexLookupExactPlain
public void testPerformanceIndexLookupExactPlain(net.minecraft.gametest.framework.GameTestHelper helper) -
testPerformanceIndexLookupItemPlain
public void testPerformanceIndexLookupItemPlain(net.minecraft.gametest.framework.GameTestHelper helper) -
testPerformanceIndexModificationPlain
public void testPerformanceIndexModificationPlain(net.minecraft.gametest.framework.GameTestHelper helper) -
testPerformanceIndexLookupExactMixed
public void testPerformanceIndexLookupExactMixed(net.minecraft.gametest.framework.GameTestHelper helper) -
testPerformanceIndexLookupItemMixed
public void testPerformanceIndexLookupItemMixed(net.minecraft.gametest.framework.GameTestHelper helper) -
testPerformanceIndexModificationMixed
public void testPerformanceIndexModificationMixed(net.minecraft.gametest.framework.GameTestHelper helper) -
testPerformanceIndexLookupItemSingleItem
public void testPerformanceIndexLookupItemSingleItem(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.
-
benchmark
protected static void benchmark(net.minecraft.gametest.framework.GameTestHelper helper, String name, int operations, GameTestsPerformanceIngredientIndex.Shape shape, Function<GameTestsPerformanceIngredientIndex.Fixture, IntUnaryOperator> operationFactory)
-