SteveKunG / MorePlanets

An add-on adds new exotic planets into Galacticraft!
https://www.curseforge.com/minecraft/mc-mods/galacticraft-add-on-more-planets
MIT License
25 stars 23 forks source link

Poor performance in SteveKunG-Lib's injectWeatherTickEvent #161

Closed tie closed 1 year ago

tie commented 1 year ago

adjustPosToNearbyEntity call in injectWeatherTickEvent seems to be loading chunks, and Minecraft keeps unloading them, causing significant performance degradation in the server thread.

https://spark.lucko.me/go5wnUNAJr?hl=26,25,52,50,59

Corresponding event handler: https://github.com/SteveKunG/MorePlanets/blob/1403fa10bd7931ccf1bf10803f8a49c74b69dc27/src/main/java/stevekung/mods/moreplanets/core/event/WorldTickEventHandler.java#L41-L42

cc @TheComputerizer as an interested party since I've encountered this issue in Dimensional Hopper modpack.

SteveKunG commented 1 year ago

You can try experimental build on my discord server. https://discord.com/channels/356400329086205953/360045643189846019/1079004666190373004

Profiler after fixed. https://spark.lucko.me/EITFodLr8v?hl=258

https://discord.gg/jdFkqCkd

SteveKunG commented 1 year ago

Fixed in 2.3.2.