Spectrum

Spectrum

2M Downloads

[BUG] Compacting chest causes massive tps lagg

justliliandev opened this issue ยท 0 comments

commented

Describe the bug
On the AOF5 server I play we had big problems with tps lagg, so we used spark to run a profiler and one compacting chest had the impact of 1.6% of the whole server ticktime. Nearly all of this time is happening in the recipemanager call.
This is happening because the cache is forgotten after each non successful crafting request, meaning it needs to look through the recipes again. Also if you have for example more than the required compacting items of something non compactable in the first slots it will combine those slots multiple times and check if a valid recipe for them can be found multiple times, causing more lagg.

I've created a better, shared cache solution in a PR coming soon, so this issue is kinda just a documentation of this problem

To Reproduce
Load a datapack with a large amount of crafting recipes and slowly fill the compacting chest using a hopper with new, non compressable items, causing the compacting chest to look for valid recipes over all item slots.

Expected behavior
The server not to lagg

Mod version
This issue was found in 1.2.8-1.18.1-midgame9, but I could also verify it in the latest github commit.