Class GameTestsPerformanceIngredientIndex

java.lang.Object
org.cyclops.integrateddynamics.gametest.GameTestsPerformanceIngredientIndex

public class GameTestsPerformanceIngredientIndex extends Object
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.
  • Field Details

    • TEMPLATE_EMPTY

      public static final String TEMPLATE_EMPTY
      See Also:
    • INSTANCES

      public static final int INSTANCES
      The number of distinct instances that is indexed.
      See Also:
    • POSITIONS

      public static final int POSITIONS
      The number of positions over which the instances are spread.
      See Also:
    • OPERATIONS

      public static final int OPERATIONS
      The number of measured operations per benchmark.
      See Also:
    • WARMUP_OPERATIONS

      public static final int WARMUP_OPERATIONS
      The number of unmeasured operations that are executed before each benchmark, to warm up the JIT.
      See Also:
    • ROUNDS

      public static final int ROUNDS
      The 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

      protected static int count(Iterator<?> iterator)
    • 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.