Hi
We are working on multiple fronts regarding the stability and performance of the Profiler. We’ve recently landed multiple fixes (for out of memory crashes) and performance improvements, in particular for Timeline view. Most of which are on the latest versions of 2019.3, 2020.1 and 2020.2 or are about to be released with the next version.
Yes. Currently all Unity UI code, whether that is IMGUI, uGUI or UIElements is Main thread bound, in the Editor and in the Player. Playmode runs in the same Main thread as the Editor, which allows for all the comforts of seamless interaction between the Editor and Playmode, but comes with the downside of these two modes affecting each other’s performance and memory usage. This is an architectural problem and not easy to resolve, but that too is being worked on at multiple fronts. One of these is Live Link, as shown at Unite Copenhagen 2019.
Another approach to this is the Standalone Profiler which was added as an Experimental feature in 2020.1. This feature will spin up a minimal Editor process that contains the Profiler tools. With this, you can profile the Editor or Playmode without the Profilers being in the same process and directly influencing what they profile. They still do so indirectly, because they share the same system and resources, but it aleviates some of the problems in this and provides cleaner profiling results. This extra process currently takes some 30 seconds to launch, which we want to reduce but this too shows that this is not a trivial problem to solve.
Another recent addition that highlights some of the issues is the addition of a “Live” toggle to not update the CPU/GPU details views while recording Playmode or the Editor by default, because that would impact the very thing being profiled or even lead to recursive Profiling of the profiler UI itself (when Editor profiling). You can simulate the same behavior in versions without this toggle by selecting a different module while recording.
We obviously want the Profiler to be as performant and useful as it can be in any context, including Editor and Playmode profiling, but the cleanest data is still going to come from profiling a different device.
I guess, all this to say: we are not just sitting on this, as well as that the issue (in some form or another) having existed for a while is in part down to structural problems that need resolving (which takes a while).
Now, with all that out of the way, I’d like to dive in a bit more into your specific issue: What Unity version are you using? What Profiler Modules were open? What were you profiling? The Editor or Playmode?
Normally the Profiler Window should only Repaint about every 5th frame of the Editor/Playmode. This should technical preclude the cost of repainting the window from stacking up frame over frame. It sounds like it might not be doing that in your case and it’d be good to know why that might’ve been. Or if this was down to something else entirely.
Lastly, we can try to troubleshoot this here but we also always welcome these kind of issues as bug reports. And just because it seems like an obvious bug and the same one over time, doesn’t mean it is, so any report that is as specific as possible in how the performance of the profiler falls short can help us uncover other issues, combinations of issues or validate existing pains.