Saving a scene cause Application.ExecuteMenuItem to take about 6 minutes to complete

After Upgrading to beta 14 my entire project slowed down. Every action takes minutes or leads to a crash. Downgrading the project version does not help. Why is this happening and how can I fix it ?
This is what the editor loged after a 10 minute wait to save the scene
"
Start importing ProjectSettings/ProjectSettings.asset using Guid(00000000000000004000000000000000) Importer(-1,00000000000000000000000000000000) -> (artifact id: '344b48fc4590ad6a6dcbfc9b57464d8d') in 0.002673 seconds
Refreshing native plugins compatible for Editor in 1.38 ms, found 6 plugins.
Preloading 0 native plugins for Editor in 0.00 ms.
RefreshInfo: StopAssetImportingV2(NoUpdateAssetOptions) scanfilter:
RefreshProfiler: Total: 154.041ms
Start importing Assets/Scenes/Main menu scene.unity using Guid(9b58d4ea5bdcd5048913957f858be1da) Importer(-1,00000000000000000000000000000000) -> (artifact id: '857e5f1e96e4fdd5ae8bc3ad4ece6abd') in 0.000802 seconds
Refreshing native plugins compatible for Editor in 1.18 ms, found 6 plugins.
Preloading 0 native plugins for Editor in 0.00 ms.
RefreshInfo: StopAssetImportingV2(NoUpdateAssetOptions) scanfilter:
RefreshProfiler: Total: 178.427ms"

Edit: Reverting back to beta 8 fixed the issues. Issues were present in beta 12, 13 and 14

Hi @YuriyPopov ,

Could you please submit a bug report with reproduction steps and ideally a reproduction project attached?


Submiting the project would be tough since it is rather large. After profiling a bunch I figured out that what takes the most time( about 12 mins) is compiling shaders and more specifically reading from the shader cache.

1 Like

Also see this on Unity 2020.2.1f1. It takes a few minutes to enter play mode.


Hey we narrowed down the issue to shader variant caching. Deleting the Library folder fixed it. Also removing a bunch of trird party shaders that were causing the spike in variants.

1 Like


How did you do it? We're having the same issue with waiting for ExecuteMenuItem, but we don't know what causes it. Editor.log doesn't have any long operations logged - only some ms or seconds, but we sometimes wait for 6 minutes.
I thought enabling Editor Deep Profiler would show something, but nope. =(

Also having this issue where saving the scene sometimes causes Application.ExecuteMenuItem to take 2+ minutes. It doesn't always happen, but I'm not sure what is causing it to happen when it does. Unity 2020.2.0f1

Edit: Nevermind, its now at 10+ minutes. Guess I'll just kill the application and reopen Unity.

Encountering the same issue when Addressable Windows are opened. Seriously annoying.

2020.2.2f1

We fixed it by removing Library folder. I guess when you upgrade often, these issues might happen

Same problem when I build addressable in android.
It's take my a lot time.

On average, it gets stuck once an hour and cannot be solved

Same issue... ( Unity 2020.2.6f1 )

and..
ShaderCache.db in the Library folder is very big size.

6923423--812342--bigsize.png

This has seriously affected my development, and I don't think such a devastating error should appear on the lts version

3 Likes

A few hours later, the problem came back

2 Likes

I'm having this issue as well, gets hung up when creating an android build and saving sometimes. Can take 10 minutes+ to complete these. Really frustrating.

I'm encountering this as well. Last two times I've saved my scene, this has run for about 10 minutes.

Same issue here. Switching scenes or saving a scene causes 10+ minutes of 'Application.ExecuteMenuItem' popup.

My ShaderCache.db is 19GB in size.

up to 12min
in
Unity 2020.3.2f1 and 2020.3.3f1

7030225--832975--Unbenannt.JPG

Is there any way to find out why?

Adressable and Package Manager Windows are closed.

[quote=“keeponshading”, post:18, topic: 820068]
up to 12min
in
Unity 2020.3.2f1 and 2020.3.3f1

Is there any way to find out why?

Adressable and Package Manager Windows are closed.
[/quote]
Read this thread from here: https://discussions.unity.com/t/777806 page-6#post-6906902
You will need to use some sort of profiler. If you find that Unity is a culprit, please, submit a bug report with hard data so they can fix it.

2 Likes

So wait is the ShaderCache.db supposed to grow to that size? I don't think that was intended behavior right?

And also, if it does grow. I guess this thread is hinting that for now, best practices for quicker editor load times, is to delete that file prior to opening up that project every time..

This is kinda hilarious. Reminds me of my Dad's old TV, where he'd used to have to give it a little wack, every time the the connection was poor or dropped, and then it works again.:eyes:

3 Likes