Glitchfiend / TerraBlender

TerraBlender is a library mod for adding biomes in a simple and compatible manner with Minecraft's new biome/terrain system.
https://www.curseforge.com/minecraft/mc-mods/terrablender
GNU Lesser General Public License v3.0
91 stars 29 forks source link

Performance issue caused by NamespacedSurfaceRuleSource #159

Open racoonman2 opened 7 months ago

racoonman2 commented 7 months ago

What's the issue you encountered?

Performance is noticeably slower with TerraBlender, even when no other mods are installed. It seems this is due to NamespacedSurfaceRuleSource calling context.biome.get() for every non empty block in the chunk, while this only happens along the surface in vanilla. This could be fixed by grouping surface rules into a single sequence instead of having them be registered per biome namespace.

How can the issue be reproduced?

Create a world with TerraBlender installed

Logs

No response

Mod Version

1.20.2

Additional information

Heres some quick tests done by someone in the TerraForged discord. They arent perfect, but they still demonstrate the performance differences pretty well (note that the fix column refers to TerraBlender with it's surface rule api disabled) image

Uniter343 commented 7 months ago

Hi, the guy who did that test here. I've also done the same thing for Terrablender with Regions Unexplored (which had a surface rule problem on their own which they solved in RU 0.5.5) Here are those results.

image-39

racoonman2 commented 7 months ago

To clarify, the version of TerraBlender used in the fix was modified to still work with Regions Unexplored's surface rules, so the world gen is still the same as normal TerraBlender regardless of the surface api being disabled

TrickShow commented 7 months ago

This is also an issue in 1.20.1

Uniter343 commented 7 months ago

It's an Issue on all Terrablender versions as far as I can tell.

JT122406 commented 5 months ago

Based on this someone made a fix? If so why not open a pr for it

MagmaBro123 commented 4 months ago

Please resolve this. Any biome mod that depends on this mod is unusable and slows chunk loading to a snail's pace.

Veynam commented 4 months ago

Gosh took me a while to find what mod was suddenly causing us slowdown. Glad this was already found reported. Hope it gets fixed soon

PakoJones88 commented 2 months ago

The diminution in performance is pretty noticeable, especially in big modpacks. Are the devs working on a fix?