Waystones (Fabric Edition)

Waystones (Fabric Edition)

3M Downloads

Extreme lag caused by getShuffledTemplates mixin

embeddedt opened this issue ยท 0 comments

commented

Minecraft Version

1.19.2 (LTS)

Mod Loader

Forge

Mod Loader Version

43.2.8

Mod Version

11.4.0

Balm Version

4.5.7

Describe the Issue

๐Ÿ‘‹ A player came to me requesting help with their world never getting off the "Loading terrain" screen. By using a profiler I was able to track down that the server worker thread doing the chunk generation/loading gets stuck inside the getShuffledTemplates code, seemingly running toString forever, or at least enough times that it completely dominates the profiler's list of hot methods:

https://github.com/TwelveIterationMods/Waystones/blob/29a686bb9e294d2d7c9b67484e410fe668c0f01c/shared/src/main/java/net/blay09/mods/waystones/mixin/JigsawPlacementMixin.java

I am aware that Waystones is a very popular mod used in other modpacks without issue so this is probably some other mod triggering the function to be run many times (possibly a structure mod). However, I would suggest that if possible the ID checks here should be cached, as needing to call toString on structure pieces over and over seems quite inefficient even if it doesn't cause issues in most cases. I'd also like to note that after removing Waystones the player's pack was able to load into the world without problems.

Logs

No response

Do you use any performance-enhancing mods (e.g. OptiFine) or custom server distributions (e.g. SpongeForge)?

There are performance mods included with the pack, but the issue occured even with these disabled.