(Case 1171344) Focusing editor causes "Waiting Mousecursor" for 2 secs before it gets repsonsive

Focusing the Editor causes a two seconds freeze with the project attached to Case 1108597 on my PC. Looking at the Profiler reveals it’s caused by AssetDatabase.V2.Scan. It probably gets worse the more assets the project contains.

Profiler Screenshot

Reproduce

  • Use hardware similar to the PC I submitted the bug-report with. You probably can’t reproduce it on high-end hardware.
  • Open project from Case 1108597
  • Open Notepad
  • Focus Unity Editor

Repeat step 3 and 4 as often as you want.

Actual
Focusing Unity Editor displays for about two seconds a “Waiting Mousecursor” before the editor gets responsive.

Expected
Editor should be responsive immediately.

4 Likes

YES this type of issue happens so often on a huge project I’m on, Unity editor wont come up after being de-focused for a bit (not out of ram or anything), often much longer than 2 seconds, really appreciate you reporting these types of issues.

1 Like

Are you using HDRP / LWRP in that project?

We’re seeing really weird glitches on focussing / defocussing Unity with everything from lights, ambient occlusion, culling, screen space reflections going crazy in specific camera positions. Focussing Unity again freezes everything for a couple seconds and then (sometimes only after shifting scene view a bit) everything goes back to “normal”.

Nope. It uses Unity built-in renderer.

This is happening to us as well. Not only that, but after the spinner, Unity also doesn’t always actually have focus. For example, hitting Control-P does nothing after tabbing back in (maybe only if it had to recompile). So these two very basic things are major usability regressions from previous versions because they stack up for a lot of lost time and frustration.

The issue is still being investigated.
Issue tracker link: Unity Issue Tracker - [Regression ADB V1-V2] Focusing the Editor Window causes noticeable Slowdowns

2 Likes

That’s great to hear! Is there a separate issue for the problems with the editor not truly gaining focus after tabbing back in from another app?

I tested this 2019.3.0f1. “AssetDatabase.Refresh” went down from 1.55s to 0.35s in the Profiler, that’s a great improvement. Great job!

The windows waiting mousecursor is still shown for I guess 0.7s though. If you want that switching to Unity feels great and instant, you might want to take a look at how to minimize the time the waiting mousecursor is shown.

A fix for this issue went into f5.

1 Like

Great! Any ETA on when that should land?

Fantastic!

The build should get promoted to QA today and could go out as early as Monday.

2 Likes

I tested it with 2019.3.0f5, focusing the editor costs about 280ms according to the profiler. I profiled 2017.4.34f1 with Case 1108597 as well and it’s “only” faster by 90ms. However, these 90ms somehow make it feel significantly more responsive.

2017.4 doesn’t have the AssetDatabase profiler marker, but if you just look at the entire “CPU” time for that “focus frame”, it seems to be about 90ms faster.
2019.3.0f5 5366904--542955--upload_2020-1-13_20-17-0.png

2017.4.31f1 5366904--542958--upload_2020-1-13_20-17-29.png

2 Likes

We have a report with the same issue, however, we are unable to reproduce the issue on our side. Maybe you know a consistent way to reproduce the issue? The information we have is that the issue reproduces when focusing on Unity after editing an XML in Visual Studio. Is this the case on your side as well?


Sadly seems to be back for 2021.1.22