Tomes

Tomes

615k Downloads

Performance issues in multiplayer during the living tick event.

Vaelzan opened this issue ยท 4 comments

commented

The easiest way to explain the issue is probably to just link a profiler report showing it in action:

https://spark.lucko.me/e7btx3xPVy

Setting Spark to show by source indicates that Tomes is responsible for a bit over 17% of the total server tick time, almost all of which is related to networking. It isn't causing any problems in single player, but I've had several independent reports of it causing severe lag on servers to the point where people have been removing the mod.

At a glance, it seems like the issue stems from here: https://github.com/VulpTheHorseDog/Tomes/blob/b57fed894dfff69f4073eac658defeaa57de9dba/src/main/java/com/vulp/tomes/events/EntityEvents.java#L247 - it probably isn't a good idea to be sending out a packet for every single living entity every tick, especially if the state of that flag hasn't changed.

commented

Maybe, I'll probably look into it. Apologies for my jank code. Anyways, issue should be fixed as of the latest version, 1.3.

commented

Just got another report from a different server where it's about 19.5% of total tick time. https://spark.lucko.me/NPvILjB0jP

commented

I think I've got it fixed up, will notify you of next release. Thanks for the tip!

commented

Just a small note since I took a quick look at it aswell: Couldnt you just spawn particles from the server via packet on the client from within your AI goal which is only ticking affected entities? then you do not need an all-entity hook at all