Opening the 'Esc' settings menu in servers with a high player count spawns many BindToRenderStep connections that do not go away

Pressing escape to open the settings menu for the first time since you’ve joined spawns many :BindToRenderStep connections that do not go away. The amount of connections spawned seems to be proportional to the server player count. In a game with 75 players, all these connections add ~0.45ms to the microprofiler’s RenderJob bar, specifically under ‘fireBindToRenderStepCallbacks’. This causes a noticable drop in FPS if the frame time is already limited by the CPU (not the GPU).

The microprofiler shows these connections belonging to a script named “Players”. We do not create a script with this name in our games. The CoreScript that I believe is responsible for the performance drop can be found at Roblox\Versions[roblox version]\ExtraContent\scripts\CoreScripts\Modules\Settings\Pages\Players.lua

Reproduction:

  1. Join a game with a lot of players in the server (>20). Do not open the settings menu yet
  2. Open the microprofiler and observe the ‘fireBindToRenderStepCallbacks’ bar. There won’t be many things running under it:
  3. Press escape to open the settings menu and then close it
  4. Open the microprofiler again and observe ‘fireBindToRenderStepCallbacks’. Many new connections will have appeared, greatly increasing the time the bar takes:

Microprofiler logs of the issue happening in two games:
Navy Simulator (~75 players in server, frame time normally limited by CPU): https://drive.google.com/file/d/1BMi-EnPkbKwBltDkmmAJKXIx8oRy84E7/view?usp=sharing
Empire Clash (~95 players in server, frame time normally limited by GPU): https://drive.google.com/file/d/1zQmxVd0UM358QqBIYxnSugLZTUmJfXL_/view?usp=sharing

Expected behavior

I would expect these created connections to be disconnected when the settings menu is closed. They can reduce FPS from running while they aren’t doing anything, and are created outside of a developer’s control.

3 Likes