Oritech Optimization

Provided performance optimization for Oritech.

Provided performance optimization for Oritech.

Here are the optimization details:

No.VanillaChangeEffect
1Powered furnace calls getRecipeFor(SMELTING) every tick; even an empty input scans all smelting recipesCaches by input item + components + count; empty input returns emptyIdle/repeated inputs go from O(all smelting recipes) to O(1)
2Furnace GUI getProgress() / getRecipeDuration() re-query recipes on every callReuses the cache from #1No per-tick full scan while the GUI is open
3MachineBlockEntity.getRecipe() re-runs getRecipeFor every tick; full scan when nothing matchesPer-machine input-signature cache for the getRecipeFor resultRepeated lookups become O(1); fewer scans for idle machines
4Centrifuge / cooler / refinery / tainted refinery getRecipe() call getRecipesFor (full scan) every tickCaches the recipe list by input signature; fluid filtering still runs per tickRemoves the full scan; only matching against a small list remains
5Centrifuge getNormalRecipe() re-runs getRecipeFor every tickCaches by input signatureNo repeated scan when no fluid addon is installed
6Whenever the pulverizer has ≥9 small dust, every craft calls getRecipesFor(CRAFTING), scanning all crafting recipes in the packCaches the recipe list by small dust item + componentsEliminates the high-frequency full crafting-table scan
7Item pipes scan every target's slots with IntStream.range(0, slots).allMatch even when not rendering itemsSkips the scan for non-rendering pipesEliminates wasted slot iteration
8Static blockedUntil entries are removed only when the source is visitedExpired entries are cleaned every 200 ticksPrevents slow accumulation in long-lived saves
9DynamicEnergyStorage with maxInsert=0 still reports supportsInsertion() = trueReturns false when maxInsert <= 0Generators and output-only storages are no longer treated as valid pipe targets
10Every energy pipe interface computes targets.hashCode() every tickCaches the hash per Set instance + size, mixed with identityHashCodeRemoves O(target count) hashing per interface per tick
11Energy pipes call transfer for every target even when it is fullSkips full or non-insertable targetsFewer no-op capability lookups and transfer calls
12No cache invalidation on recipe reloadsBumps epoch and clears caches on server reload/start/stop and client recipe updatesNo stale recipes after /reload or rejoining

Oritech Optimization Team

profile avatar
  • 3
    Followers
  • 17
    Projects
  • 17.6K
    Downloads

If you have any good ideas, or if you simply want to say a few words, feel free to send me a private message. I might not be very timely in replying, but right now it seems I have nothing left besides building projects.

More from anderlyerView all