UIs continue to trigger UpdateUILayouts in the microprofiler when the updated elements are invisible or when the root ScreenGui is disabled.
References:
Reproduction file: Bug.rbxl - view microprofiler while running - chat commands:
- reset: Enabled = true, Visible = true
- disable: Enabled = false, Visible = true
- invisible: Enabled = true, Visible = false
- fulldisable: Enabled = false, Visible = false
This is causing a ton of unnecessary processing (~2ms on a very high-end machine) in some of my games due to animated UI content, forcing me to now implement deeply unintuitive workarounds such as deparenting SurfaceGuis at distance and deparenting menu UIs when invisible.
Expected behavior
I expect UpdateUILayouts to not trigger if any ascendant UI objects are disabled or invisible. Would be nice if it only re-processed when Visible or Enabled is set to true again.