Alchemistry

Alchemistry

16M Downloads

TPS Performance issue caused by updateRecipe

Fros1er opened this issue ยท 0 comments

commented

Playing ATM9 with minecraft 1.20.1, Chemlib 2.0.19, AlchemyLib 1.0.30, Alchemistry 2.3.4.
Spark reported 1.5ms per ticked used by AlchemyLib, with only ~10 dissolvers.
image

I think the issue is that AbstractProcessingBlockEntity calls updateRecipe every tick, which iterates over dissolver's recipes. Unfortunately, the recipe is a linked list, and iteration is time consuming.

Maybe it's better to use a map rather than LinkedList here? Also, I'm not a minecraft modder, so I wonder whether it's necessary to update recipe on every tick.