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


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.


@Tiffblocks @darthskrill


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.


Is this fix live? Noticed the name of the bar has changed (now it also includes tweenservice)


No, I moved around some of the microprofiler labels to happen in more meaningful locations and have better names.

I’ll be turning on the change as soon as I can, it’s still in testing.


The fix is live now.