Search Unity

compiing c# scripts (busy for 45 seconds) freeze

Discussion in 'General Discussion' started by yuiss, Mar 22, 2021.

  1. yuiss

    yuiss

    Joined:
    Jul 5, 2017
    Posts:
    2
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Does it eventually finish, or was 45 seconds too long to wait? How long it takes depends on how much compiling it has to do, and the performance of your computer hardware.
     
    Antypodish likes this.
  3. yuiss

    yuiss

    Joined:
    Jul 5, 2017
    Posts:
    2
    Does the process take that long usually? It's freeze, means apparently no progress, 45 seconds or whatever is not matter, tho I waited 20 or 30 minutes. My machine is not a bad one. gtx 1050 ti, intel core i7 gen 7, 64 gb memory, ssd.
     
  4. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    See the task manager
    The older version (unity 2019) just freeze until compile to be completed
    The unity 2020.2 just shows you a progress bar on the freeze time
     
  5. cyangamer

    cyangamer

    Joined:
    Feb 17, 2010
    Posts:
    234
    For me, Unity usually takes about 30 seconds every time I make a change in C# and it's a small game (and I also have a machine with good specs), so yeah. However, 20 to 30 minutes is definitely not normal. I wonder if there's something on your system that could be interfering with Unity's process? Maybe an antimalware program?
     
    Joe-Censored likes this.
  6. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,129
    Your CPU is very limited by today's standards. Unity's complation stages are becoming progressively more multi-threaded making it very important to have a high-core count processor. Intel's 7th generation processors are just four cores when most modern processors at that tier are now 8 (Intel) to 12 (AMD) cores.

    Check out assembly definitions. They exist to minimize the amount of code that is recompiled with a code change.

    https://docs.unity3d.com/Manual/ScriptCompilationAssemblyDefinitionFiles.html
     
    Last edited: Mar 28, 2021
    Joe-Censored likes this.
  7. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    The same CPU compiles the same script better in previous unity versions
    The problem is from unity side (if it's a problem )
    I will compile with Q8400 in a few seconds on 2020.2
     
  8. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,129
    I don't see them saying that anywhere in this thread.
     
    MadeFromPolygons likes this.
  9. BennyTan

    BennyTan

    Joined:
    Jan 23, 2014
    Posts:
    141
    i'm developing on a i7-8550u (Dell XPS) most of the time and compile times are pretty ok, normally between 5s to 20s for changes. It seems you are on the package manager screen, did you just import some package with tons of scripts?
     
    Joe-Censored likes this.