This performance profile from a multiplayer server with many players reveals a performance issue in this mod when many players join a server, consuming about 0.1 ms/tick. https://drive.google.com/file/d/1QleU9Hl7DZJnavPceqR_qiIi0ZhE7F0O/view?usp=sharing
The save in question: https://drive.google.com/file/d/1EIpE8g6PuJJeyk02Q9vlg914lZ54Mv9s/view?usp=sharing
The root cause is in the mod's on_tick event:
|
script.on_event(defines.events.on_tick, function(event) |
The problem is that the mod runs an on_tick event that loops through every player and attempts to update the player's gui. The size of this loop could be reduced by instead looping through a list of players that currently have a gui opened. Using on_gui_opened and on_gui_closed events, you can create a storage table that contains a list of all players that currently have a gui opened. Looping through this smaller list during on_tick would yield great performance improvements on large servers.
This performance profile from a multiplayer server with many players reveals a performance issue in this mod when many players join a server, consuming about 0.1 ms/tick. https://drive.google.com/file/d/1QleU9Hl7DZJnavPceqR_qiIi0ZhE7F0O/view?usp=sharing
The save in question: https://drive.google.com/file/d/1EIpE8g6PuJJeyk02Q9vlg914lZ54Mv9s/view?usp=sharing
The root cause is in the mod's on_tick event:
FilterHelper/control.lua
Line 695 in 53d5018
The problem is that the mod runs an on_tick event that loops through every player and attempts to update the player's gui. The size of this loop could be reduced by instead looping through a list of players that currently have a gui opened. Using on_gui_opened and on_gui_closed events, you can create a storage table that contains a list of all players that currently have a gui opened. Looping through this smaller list during on_tick would yield great performance improvements on large servers.