
XP pulling causes heavy lag on servers
twothe opened this issue ยท 2 comments
This line of code drains about 20% of the server performance using ATM7 (see this log for details). The reason seems to be that every existing entity is added to the map, regardless of whether it has mending or not. This list tends to become huge on larger servers, and walking through it with forEach every tick drains a lot of CPU time for no reason.
I assume that entities are in addition not removed properly from that map, as even a list of 2000 entities shouldn't cause a 20% CPU usage.
Spark profiler dump where I was seeing the same thing: https://spark.lucko.me/8QxAIEymIG