Lag in checking mod presence
LemADEC opened this issue ยท 4 comments
As of astralsorcery-1.12.2-1.9.4, lag is observed from checking mod presence.
Consider cashing mod presence instead of doing constant lookups, or even cache the fakeplayer ids in
That's 0.41% CPU consumed by your mod for just 5 players. That event is called for each player, real or fake.
Imagine what happens with 50 players online.
The fake player stuff is only 0.14%, not 0.41%. There's a lot more going on with that 0.41% than fake player checks.
Imagine what happens with 50 players online.
Imagine the amount of OTHER STUFF that's going on when 50 players are online. This is the least of your problems by then. Also, this is NOT 0.41% of your CPU power, this is 0.41% of the total time this consumed of your CPU usage on the snapshotted process during the time the snapshot was taken. So it is by no means 0.41% of your CPU power. It would be 0.41% if ALL CORES of your ENTIRE CPU ran 100% usage the ENTIRE time of this snapshot. Which is more than unlikely.
Either you are knowledgeable enough to see that or you are free to reduce those 0.41% to 0.38%. great job. you saved about 200 nano seconds then. Now go calculate how much 200 nano seconds are in relation to 1 millisecond. If something's lagging your server from whatever snapshot you've shown a piece of above, it's not this section you've shown. That's all there is to say. Have a nice day.