LLibrary

LLibrary

67M Downloads

Lag in ServerEventHandler.onEntityUpdate

LemADEC opened this issue · 12 comments

commented

As of llibrary-1.7.14-1.12.2 + iceandfire-1.5.2, profiler reports high CPU usage in calls to LivingUpdateEvent handler.

image

commented

This issue caused us to remove IceAndFire from all our public 1.12.2 servers. I remember having lag issues with Mowzie's mobs too, not sure if it was the same rootcause.

commented

What exactly is this used for? I assume this is being run for all entities and not only for entities which use this lib or?

commented

It is only being used on IaF entities that make use of this feature -- it automatically syncs entity data when it changes. However, comparing the data is quite an expensive operation. It is not a very good system. :P

commented

Adding this to this issue too:

commented

could we throttle the updates so the NBT compare happens less frequently?

commented

I am having this exact same issue https://gyazo.com/386d0093423a82d42e96fe06ac61adcd
i am on version 1.7.18

EDIT: ignore this going to tag myself to keep track of this @runescapejon

commented

I believe I've created a non-breaking fix for this in #136
That said, this system should still be broken apart when you actually want to do breaking changes.

commented

Pushed a build out now -- thanks for the reminder.

commented

@gegy1000 were you ever planning on making a release for this?

commented

Yeah that code seems to not have been written with performance in mind, at all. Changing this would be a breaking change so will have to come in 1.13.

commented

Any chance we could get a partial fix to reduce the impact on 1.12?

commented

No, it's unfortunately a flaw in the design. I doubt it could be optimized at all.