Allow for stepping through all the render and- simulation steps granularly

As I debug various performance-sinking scenarios, such as the instantiation and updating of expensive UI, it becomes incredibly difficult to accurately pinpoint and latch onto what exactly causes performance issues.

Currently, I am forced to employ a variety of tools:

  • Listen to DescendantAdded and even the eons-forgotten ItemChanged events, to pinpoint which properties are being updated more frequently than they should be
  • Manually look at & monitor which UIs are being updated when they shouldn’t be
  • Gather microprofiler logs to get a better picture

All of these are very time-consuming, and never paint the full picture. A UI frame can be updated multiple times in the same frame, or several frames in a row, and without e.g. recording a video and looking through it in slow-motion, one frame at a time, it is hard to notice these subtleties.

It would be extremely helpful if we could step through the various engine simulation steps, one step at a time – through the UI update layout, to post-layout dispatching, to the other events like Stepped and Heartbeat, and anything inbetween them. Of course, I understand that many such steps are ran in parallel and are not synced with one another, and some only run every X frames, but its usefulness in debugging would far outweigh the negatives. It’d be much better than the existing tooling!

2 Likes

simulation can be stepped manually.

In new UI:

In old UI:

Additionally there is Workspace::StepPhysics API that can be called in plugins, for more control.

I don’t think these work for the render/UI loop, but I agree it would be nice to have, we can look into it.

I am indeed aware of it! However it’d be great to have more granular control, especially for sub-frame steps. though, as I recall on the original beta/release threads, there were complications that made this complex to implement?