McJtyMods / InControl

Be In Control of Mob Spawns and others
MIT License
46 stars 17 forks source link

[1.16.5] "maxheight" condition seemingly causing extreme lag #371

Open antibang opened 1 year ago

antibang commented 1 year ago

I've noticed that the condition "maxheight" in the spawn.json file causes some extreme lag. I've taken many Spark reports that point to that, so, I rewrote all of my rules that included that condition in that file to completely eliminate the use of maxheight. This kind of helped, however, it seems that getHeight and/or getChunk is causing additional lag as well, even without the use of maxheight.

I should mention that I have RoadRunner installed. I know that this can conflict with many things, so I felt the need the mention it.

Here is the Spark profiler I ran with the maxheight condition in the spawn.json file: https://spark.lucko.me/KlZcKuHGYc

Here is the Spark profiler I ran without the maxheight condition in the spawn.json file: https://spark.lucko.me/7YixW2LvZQ

McJty commented 1 year ago

hmm weird. maxheight is a really light test. That shouldn't cause lag. Can you show me your full spawn file?

antibang commented 1 year ago

Yup! Sure thing. Hopefully sending it as a text file works:

spawn.txt

I know I kinda go ham with the onjoin condition, but I don't know if that is causing the extreme lag. I typically only use it if my rule(s) just aren't seemingly working as I intend them to. Though I did test most of these without that condition to see if it'd help and got the same results in the profiler.

McJty commented 1 year ago

You are not using maxheight here. So that's not very useful to me

McJty commented 1 year ago

I thought it was maxheight causing lag?

antibang commented 1 year ago

I apologize! I sent the one I recently tweaked before submitting a report :/ This should be the correct one:

spawn.txt

McJty commented 1 year ago

Hmm no idea. 'maxheight' itself is an extremely light condition. 'onjoin' and 'structure' are much heavier