Search Unity

Resolved Unity compilation takes 235 seconds... (ImportAndPostprocessOutOfDateAssets)

Discussion in 'Editor & General Support' started by zh4r0naX, Feb 6, 2021.

  1. zh4r0naX

    zh4r0naX

    Joined:
    Oct 30, 2016
    Posts:
    71
    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
     
    Last edited: Feb 6, 2021
    MartinTilo likes this.
  2. christianmahler

    christianmahler

    Joined:
    Jul 9, 2017
    Posts:
    33
    The same, I'm on 2020.2.3f1, can't work like this. Compiling C# Scripts takes forever since 2020.2.2f1.
     
    Last edited: Feb 6, 2021
  3. zh4r0naX

    zh4r0naX

    Joined:
    Oct 30, 2016
    Posts:
    71
    Well the solution for me was to profile it.

    1. Increase Profilerframes, because you need to stop it after the lagg ends.
    2. Set Profiler to Editor and Deep Profile
    3. Compile some scripts
    4. Pause Profiler
    5. 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.

    https://imgur.com/iaKwtde

     
    MartinTilo likes this.