Supplementaries

Supplementaries

82M Downloads

[1.18 1.1.1] Major lag caused by passive animals

Goldenlion5648 opened this issue ยท 3 comments

commented

I noticed that the TPS was really bad in a fairly empty void world. The command /forge tps showed that mean tick time was 49. It mentioned passive animals (which I had 1 cow). After killing the one cow, the mean tick time went to 3. I used the spark mod to profile it, https://spark.lucko.me/BkXsYALmxc and it was being caused by Supplementaries. (I tested again by spawning in 4 cows and the tick time shot back to 49). After removing the mod and spawning in some cows, the tick time remained at 3.

commented

Actually not totally sure if this was due to Supplementaries or not

commented

That is caused by my eat fodder goal. The tick time seems high indeed and I know I can somewhat make it faster by decreasing its frequency, however I think a test in this conditions is a bit misleading since in that scenario you just had 1 mob which was executing pretty much just 2 goals, random stroll, which doesnt need many checks and mine so of course the most intensive one would show up there as the dominant one. Ai is known to be the main cause of lag in many circoumstances, just cause it runs every few ticks and has to constantly do some checks and things of the sort.
Could you try doing the same test but add to the mix some other more complex entity like a villager or better yet a zombie, since their break turtle egg goal is pretty much the same as my fodder one? What I mean by this is that what it matters is how the goal is intensive compared to other ones

commented

I also think I spotted where it was causing lag: it pretty much was executing some unnecessary checks when on cooldown. As i've said I've copied the turtle egg breaking code and that too has the same issue of course (which I can't fix since it's vanilla code) so I wonder what your test will tell about this.