There was a time back in 2014 where I could start the editor in a couple of seconds, fire up the Profiler and start investigating issues without hell breaking loose. But today, I have to deal with a UI that runs in slow-motion, spews exceptions and breaks down completely from time to time, or simply freezes if certain settings (like UI markers) are enabled.
Some of these are issues, that I’ve reported via the bug reporting tool, but others, like the general performance, aren’t taken seriously by QA, so who do I bring this up to? Performance and stability aren’t optional and can’t be fixed later, because I can’t use the tools at all if they break down.
I’m only ever working on small projects, so this is not about making the Profiler handle difficult scenarios. There are only a few dozen scripts and objects in the scene, nothing really going on and the Profiler is unreliable on other developer machines as well.
The most important for me would be the Profiler UI sometimes throwing exceptions and completely breaking: Case 1313542
The issue may be difficult to reproduce, but the report includes a stacktrace. I can make it happen if I profile, then pause and expand one of the foldouts in the Profiler Hierarchy view while holding the alt key (to expand all items at once).
Regarding the overall performance, I can’t really report anything but to say, that the Profiler window is laggy or has issues connecting or freezes. Some cases I observe in my daily work:
Profiling the editor or playmode via the in-editor Profiler is the most reliable stability-wise, but it can be very slow, especially when deep profiling. Often, the recording works fine, but when I stop and try to expand the Hierarchy foldouts while deep profiling, the UI takes multiple seconds to respond. When uncollapsing a stacktrace of 30 calls, this becomes unbearable. It’s much better if I can use the shortcut via the alt key to expand all of them at once, but most of the time the UI completely breaks after that (see the case above).
Profiling a device (mostly Android) is often better performance-wise, but also relatively unstable. Sometimes it connects perfectly, other times, the Profiler simply doesn’t connect and shows no error. Rebuilding often solves the issue, but is very annoying, because nothing changed in between these builds.
Using the Profiler as a standalone process should, in theory, increase profiling performance, but I don’t really notice much of a difference. On the contrary, just today I had the standalone profiler cause a 200ms delay on each editor frame just while browsing the Profiler hierarchy (no recording active at this time). Once I close the Profiler process, the editor became responsive again.
The profiler froze completely multiple times when I tried to investigate UI issues by looking at the UI and UI Details modules. It may be related to the “UI Profiler Markers” labels, because the UI became laggy as soon as some markers showed and froze completely after more of them came into view while scrolling. It also looked like many marker labels (more than 20) were drawn closely together and partially on top of each other.
One thing I haven’t tried recently was too drastically reduce the number of profiler modules, maybe this helps. Currently I’m using:
I can see how that would be hard to reproduce reliably and want to apologize for not finding and fixing this one earlier, but if I’m not mistaken, I fixed and backported an issue fitting that stack trace last week. It should be in the next updates to 2018.4, 2019.4, 2020.2, 2021.1 and 2021.2.
It was quite a weird one which resulted in very random behavior that made me wonder how hierarchy expension and the migration of the expansion state across frames ever worked… Aaaanyways, that’s done with and about to be shipped to an editor version near you, also with new automated tests to ensure that it won’t regress again.
Yeah, we’re sadly aware of connection issues and are fixing different expressions on that same theme on multiple levels, e.g. a current fix circling in a landing pattern is around adb issues. While the fix is not entirely landed and backported yet, it should make things a whole lot more stable for Android. Hopefully things will look quite a bit different as these fixes get backported over the coming weeks. As the connection is quite fundamental, it’s a bit slow going because we need to make extra sure all bases are covered with these.
Are you building with Autoconnect? Are you using build and run? We’re fixing things up around that too but without these fixes, Autoconnect can sometimes get in the way, especially if you had to restart the editor after making the build.
As for the UI Profiler Module’s performance, could you please file a bug report for these and ping me the issue ID?
As for the Standalone Profiler, we might’ve taken that one out of experimental prematurely and are reevaluating things around that and Profiler Window performance. A bit too early to say too much more on that yet though. But for 2021.1 we’ve already worked on some performance improvements for the charts, Hierarchy might need another look…
It should definitely reduce the profiling overhead as closed modules don’t record anything and therefore this lowers your intrusion cost.
Thanks for the info, looking forward to these fixes!
Yes, without having counted stats, I felt like autoconnect was actually working more often, but I could be mistaken. I’ll try without it next week. Thanks for the tip!
Oh yeah, to make matters more complex, the Hierarchy had another separate issue that would randomly hide branches of the tree when profiling Editor or Playmode. That fix landed earlier already but depending on which version you’re on, you might need to update to a later patch to get it, see the ticket for that bug for details. With the fixes for those two bugs I added an extensive UI Test suit for Hierarchy and Timeline views, including more detailed performance tests, so it should only get better from here on out.
That’s great news, thank you! We’ll be updating to the next version then.
I’m trying to reproduce the UI freeze when scrolling to the UI Markers, but today, of course, everything runs very smoothly.
Yesterday I profiled this ugly piece of UI rebuilding going on and it caused the profiler to freeze completely. It also happened twice in a row and the overall performance was really slow yesterday.
However, apparently after restarting everything, the issue seems completely gone. So sorry for maybe leading to a dead end with the UI markers, I can only attest to more general performance issues that regularly happen when I don’t try to report them, like in the middle of the day when building, testing, and profiling continuously.
I might not reproduce this when starting fresh, but I’ll see if I can capture anything next week while working again.
But again, thanks already, I do have hope for the future again!