Unity compilation takes 235 seconds... (ImportAndPostprocessOutOfDateAssets)

Hello,

ive got the problem that when i compile scripts it takes 235 seconds to complete. This happens 100% of the time right now. But iam not sure why this is happening. It started slowly yesterday. When it happened like 2 times the day, in the evening it was at 100%.

I took a view at the Editorlogs, when i stopped at this line which should be the cause of this.

RefreshProfiler: Total: 235264.979ms
ImportAndPostprocessOutOfDateAssets: 234961.442ms (232359.617ms without children)

How can i stop this, and what did i do wrong? It came up suddenly.

EDIT: iam on unity 2019.4.19f1

Now i switched to 2019.4.18f1, it worked for 30 minutes. And now the problem is back again. This is so odd. I restored to a point in the project where this wasnt the case. still not getting better.

Already tried to delete the library folder. No success…

EDIT: Now after a few hours and searching i guess i found the root of this problem. I attached the profiler with deep profile for the editor. Saved a script and right after those 4 Minutes i captured the profiler to see what did this.

Seems like i had a problem in a script which i had created 1 year ago. While i cant tell how it can come up now and cause problems like this. Hopefully this is really the case.

Thank you for your time
-Justin

1 Like

The same, I’m on 2020.2.3f1, can’t work like this. Compiling C# Scripts takes forever since 2020.2.2f1.

Well the solution for me was to profile it.

  • Increase Profilerframes, because you need to stop it after the lagg ends.
  • Set Profiler to Editor and Deep Profile
  • Compile some scripts
  • Pause Profiler
  • Switch to frame and take a look where the most Seconds are passing.

This showed me a script where a problem was. Maybe this will help you.

Imgur

1 Like