davenonymous / BonsaiTrees

A Minecraft mod adding a block that grows small trees
https://minecraft.curseforge.com/projects/bonsai-trees
MIT License
42 stars 64 forks source link

Unnecessary waste of performance on recipe search #302

Closed twothe closed 2 weeks ago

twothe commented 2 years ago

While analyzing performance of my server I learned that BT3 constantly searches through the recipes to figure out what to generate.

While this is not a problem on smaller modpacks it becomes a significant loss of performance on larger modpacks like ATM7.

Instead of querying the recipe every single tick it would be sufficient to figure that out once the current growth time has ended and/or the sapling slot has changed. Worst time - if any mod somehow changed recipes, it will waste one growth time, while at the same time the CPU time will go down to almost nothing. Even better solution would be to just cache the recipes locally, as there are usually not that many saplings that are processed.

Sixdd6 commented 1 year ago

Dear god yes please fix this, I'm working on a modpack that includes over 300 mods and it wasn't till I finally got into mass testing that I realized that this was a problem. I know, begging doesn't get us anywhere, just wanted to make sure it is known that this is still an issue.

davenonymous commented 3 weeks ago

If you have the time to re-test this issue with the latest version, it would be greatly appreciated.