EdwinMindcraft / origins-architectury

MIT License
20 stars 17 forks source link

EXTREME TPS LAG #292

Open archynoid opened 1 year ago

archynoid commented 1 year ago

I've been going around trying to get to the bottom of the TPS lag that is occuring on a server I am running. This is the third and final place that I've come to and considering I can't even find a discord for the forge port makes all this so much harder as the origins fabric discord doesn't provide support for forge. TPS spikes hard as more and more people join and it doesn't recover unless people leave. For some reason origins is executing a massive amount of recipe/inventory related commands and I have 0 idea as to why. It is currently taking up 50% of the entire server thread by itself and its ridiculous. I have a few screenshots of what is happening, do you have any idea what this might be?

Server Thread pic 1 Server Thread pic 2 Additional Entity Attributes (origins forge only view) image 1 Additional Entity Attributes (origins forge only view) image 2

EdwinMindcraft commented 1 year ago
  1. There is no discord for forge as community management is absolutely not one of the skills I have.
  2. Origins doesn't run the clear command, at least not with default origins, that's a datapack oversight.
  3. The way recipe lookup is implemented is bad, as in doubles recipe lookup time bad. I'll try to not lookup recipes if the player doesn't have one of these powers, but that has a cost too.
404Mate commented 1 year ago

I have no origins datapacks on the server i am running and additionalentityattributes is also using a large portion of my server

image

EdwinMindcraft commented 1 year ago

That's not aea, if you look at the package name, it's mostly apoli.

EdwinMindcraft commented 1 year ago

If you can, I'd be interested in the stacktrace for IPowerContainer.hasPower. There might be some things that can be done there also.

404Mate commented 1 year ago

@EdwinMindcraft how can I go about getting that for you?

EdwinMindcraft commented 1 year ago

Same thing you did for your first picture (Server Thread pic 1), just expand the tree as much as possible.

404Mate commented 1 year ago

I can't find it in all view image Right now TPS is fine so I cant run a profile

EdwinMindcraft commented 1 year ago

Don't worry, what you've given me is basically what I wanted. I think I have an idea to make it run faster, at the cost of a bit of memory.

404Mate commented 1 year ago

Alright, thank you!

zlainsama commented 10 months ago

Has this been worked on?

I am experiencing TPS lag, and by using Spark I found out it was mostly Apoli with MineColonies' citizens. It was checking all the items in those citizens, making copies of each item along side with their capabilities, which apparently uses a lot of tick time. (EntityLinkedItemStack) Beside checking items in living entities, it is also using a notable amount of tick time checking PhasingPower and ClimbingPower for living entities. (GlobalPower)

Is it possible to add a switch to disable all those parts if no registered power uses those (EntityLinkedItemStack and GlobalPower)?

MerchantPug commented 9 months ago

Has this been worked on?

I am experiencing TPS lag, and by using Spark I found out it was mostly Apoli with MineColonies' citizens. It was checking all the items in those citizens, making copies of each item along side with their capabilities, which apparently uses a lot of tick time. (EntityLinkedItemStack) Beside checking items in living entities, it is also using a notable amount of tick time checking PhasingPower and ClimbingPower for living entities. (GlobalPower)

Is it possible to add a switch to disable all those parts if no registered power uses those (EntityLinkedItemStack and GlobalPower)?

Your issue is different this one.

And I do have plans to optimise EntityLinkedItemStack next update, it wasn't really a good point in Origins Fabric until recently.