Search Unity

How to improve compilation time?

Discussion in 'Scripting' started by Patrascu, Dec 15, 2016.

  1. Patrascu

    Patrascu

    Joined:
    Jan 20, 2016
    Posts:
    59
    What is the best practice for improving compile time in a relatively large project with over 2000 scripts?
     
  2. dutchkiller2000

    dutchkiller2000

    Joined:
    May 13, 2016
    Posts:
    121
    using less lines and less spaces
     
    Ian094 likes this.
  3. kru

    kru

    Joined:
    Jan 19, 2013
    Posts:
    452
    Ryiah, Kiwasi and image28 like this.
  4. Dameon_

    Dameon_

    Joined:
    Apr 11, 2014
    Posts:
    542
    Get an SSD.
     
  5. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,334
    This post right here is really old, but the advice is still good. The most important points are:

    - UnityScript (and boo!) is much slower to compile than C#.
    - It's faster to not compile code than to compile it! Code in a .dll won't get recompiled. Code in plugins won't get recompiled unless you change other code in plugins. If you can take big chunks of your project and extract it into a .dll, that'll help a lot.
     
  6. Dameon_

    Dameon_

    Joined:
    Apr 11, 2014
    Posts:
    542
    That will improve compile time marginally, if at all. The compiler could care less about how many lines and spaces there are...removing them is one of the first steps, and it's probably one of the cheapest operations involved in the whole process.
     
    Ryiah and Kiwasi like this.