[1.16.5] Possible performance issue
ocram9 opened this issue ยท 8 comments
When a lot of bees are flying around an occupied hive (in an enclosed space), a server starts to take a performance hit (according to performant mostly, have noticed it slightly when casually playing). According to performant the task FindNestGoal is to blame.
That said, I'm aware that performant itself might be causing the issue because it changes a lot of things. I decided to post an issue here anyway so maybe you can make some more sense of it and possibly improve performance.
If you need any other logs let me know.
Performant warning: https://gist.github.com/ocram9/cfb8fc3dbf9dbe50083a6c85d615e207
Thank you for the report. How many bees are you having and do they all have a hive to live in? I am not adding a whole lot to that AI Goal compared to vanilla, so it would be interesting to see if Performant would complain the same if it was vanilla bees.
I know that bees that can't find a hive to live in, or worse, can't find a flower to pollinate, take up a lot of CPU time, but this is a problem in vanilla.
Yeah, it might be vanilla then. Performant gave a slightly different message for the vanilla bee but it's the same problem basically: https://gist.github.com/ocram9/f3420971c275d463011f441dd9c48ad8
I did find that these problems also happen when there is room in a hive and flowers to pollinate but that might also be a vanilla problem.
There is one thing that might mitigate this problem, the BaBee upgrade basically produces bees forever as far as I can tell which, combined with chunk loaders, can cause issues quite quickly. Maybe change the behaviour of the upgrade to only allow baby bees to spawn that fit in the hive + expansion (and possibly hives in the area). This way they won't keep spawning and create this lag.
In my case, I had 16 nests with well over 300 bees colonizing them. Reducing them to 5 per nest (So roughly 80) didn't actually change this warning.
it does stop at some point, there's a config for how many bees there need to be around the hive for it to stop working
Ah I see, fair enough. It also seems to have settled down a bit (@JNoppers and I are playing on the same server) and I'm not getting the messages constantly anymore. It took a few minutes but the performance is better after removing a lot of bees around occupied hives
I have done some stuff to improve the find flower goal so it doesn't trigger every damn tick like the vanilla does. I could probably do the same for the hive goal.