TheCodex6824/ThaumicAugmentation

Small but suspicious TPS lag on `WardEventHandler.onWorldTick`

Krutoy242 opened this issue · 14 comments

My E2E-E server run with 9 people.

I noticed ~3% TPS caused by Thaumic Augmentation when profiling with Spark:

image

https://spark.lucko.me/dgYOuB47ke

debug.zip

As far as i get from source code, this part of TA somehow handling warding or something.

  • Is there any way how i could get rid of this lag?
  • Maybe there is some kind of blocks that causing it?
  • Is it possible to disable a feature if nothing else helps?

That event handler is for stopping scheduled ticks on warded blocks. The intention behind blocking them is so that they don't change themselves into something else or otherwise react to their environment. As an example, this is how you can ward something like a redstone repeater and have its output not stop. To directly answer your questions:

  • There is no way to really reduce it, short of either me changing the code to either not do that anymore or do it more efficiently. Doing it more efficiently is possible but will take some work.
  • It has to go through that loop for each block that has a scheduled tick, which there can be a lot of.
  • There is a config option to disable warding - disableWardFocus. That will stop that event handler from running at all, but of course you will lose the feature.

Thank you for answer!

As far as I know disableWardFocus would completely disable whole warding mechanics? Can you make configurable option to just disable this "scheduled tick" mechanic?

Thank you for answer!

As far as I know disableWardFocus would completely disable whole warding mechanics? Can you make configurable option to just disable this "scheduled tick" mechanic?

A bit late, but the answer is yes. I added a config option that disables what are IMO the biggest potential offenders for performance, since I think some may be worse than others depending on the modpack. They are:

  • Scheduled tick events (your issue)
  • Random tick callbacks
  • Neighbor block update events

Would that be ok with you?

Probably would be good.