[Performance regression] New blocking job on main thread for UI-related tasks


#1

New performance regression in the latest update.
What looks like a new job running every frame (blocking the main thread), looks like all the “UI Layouts” that used to happen on lua-call have been moved here.

Looks like the job happens every frame.

The entire job takes around 4ms (every frame), with the “step” portion taking 2ms (in this game on the computer I’m currently using).

Regression: A few months ago before any ui system updates, this job (and the 4ms penalty on every frame) did not exist.

Repro: Join this game: https://www.roblox.com/games/698448212/RoBeats-MMO-Rhythm-Game

  • Make sure you join a fairly-full server.
  • Set graphics settings to max.
  • Make sure chat is visible.


#2

@Tiffblocks @darthskrill


#3

This regression is caused by a few microseconds of work being done every frame per-GuiLayerCollector. In places with hundreds of them, it can add up. This never came up in performance testing because most games only have a few. I’m working on a fix now.

Edit: I have a fix now which takes it from 4ms to 0.1ms on my machine.