1.12.2 Focusing starlight on inert blocks in the world can cause gratuitous amounts of lag
Buggy123 opened this issue ยท 2 comments
MC version: 1.12.2
AS version: 1.10.19
modpack: FTB Interactions
Focusing starlight on inert, non-transmuting blocks (such as dirt, cobblestone, or air) will cause lag, with no apparent upper limit:
Profiler report
Modlist
Testworld
Twitch export
I reported this on discord a while ago, but it was recommended that I make a github issue report, so I'm making one now.
The issue is in https://github.com/HellFirePvP/AstralSorcery/blob/master/src/main/java/hellfirepvp/astralsorcery/common/base/LightOreTransmutations.java#L120, when it looks through a recipe by iterating through the entire list. Since FTB Interactions has roughly 550 transmutation recipes, doing this per block adds up.
Changing https://github.com/HellFirePvP/AstralSorcery/blob/master/src/main/java/hellfirepvp/astralsorcery/common/base/LightOreTransmutations.java#L39 to an ArrayList completely fixed the issue on my local build; I no longer see that function in the profiler. However I only have a few blocks with starlight, so it went from 0.2% of time -> 0. A hashset may be better.
astral_before.zip
astral_after.zip