Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Is there a way to increase script compile speed?

Discussion in 'Scripting' started by leegod, Oct 31, 2014.

  1. leegod

    leegod

    Joined:
    May 5, 2010
    Posts:
    2,472
    1. Use More powerful CPU?
    How much speed can increase if I use desktop i5 760 @2.8GHz rather than laptop cpu i5 4200u @1.6GHz?
    I feel 1~2 second more faster in case of desktop.

    2. Input to Standard Assets folder?
    I googled and someone says put stable codes at [Standard Assets] folder and unity will not compile in that folder if the scripts inside of it didn't changed.

    Is this true?

    3. Any other good way?

    Thanks.
     
  2. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    This will help, although I suspect that you will notice more gain if you go for an i7 chip. Also having a reasonable amount of fast RAM can help.

    Compiling your scripts to DLL's can help to reduce compilation time since they are already compiled.
     
  3. sluice

    sluice

    Joined:
    Jan 31, 2014
    Posts:
    416
    Scripts in C# or use DLLs
     
  4. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
  5. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,294
    I'll second this. In our experience, C# compiles significantly faster than Boo. I wouldn't be supprised if it's also faster than JS.
     
  6. leegod

    leegod

    Joined:
    May 5, 2010
    Posts:
    2,472
    I am writing in C#.

    But not use .DLL
     
  7. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,514
    I have a large part of my project in a dll, when the project compiles it has reduced the speed significantly. BUT, when I recompile said dll and bring it into the project, it takes EXTRA long. So editing the code in said dll actually takes a bigger impact (it also gives you debugging issues as you can't easily jump to the line where code failed from unity, or put breaks in the code. You can however, as long as the pdb/mdb are included, step into the code).

    My project that's not in the dll's is still fairly large, and is a mix of js and C# (mainly because my artist keeps ganking small code snippets off the internet and just slapping them in the project with out asking me first... grrrrr, talk about debugging nightmare!).

    My compile times are usually very low, if not even noticed. If I do big changes around the entire project I 'might' get a 3 or 4 second compile time.

    I also run on an i7-2600K @ 3.4ghz, with 32 gigs of RAM. Which probably plays a big role in that.
     
  8. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Just stick your scripts in a 'special' unity folder like Standard Assets or Plugins and it should reach dll speeds in compilation. Or come pretty close since they don't get recompiled unless fiddled with.
     
  9. ababab5

    ababab5

    Joined:
    Apr 15, 2014
    Posts:
    508
    I'm on a mac pro quad core 3.7GHZ with 32GO of ram and I can see on my activity monitor spike at 99% of the cpu from MONO ... :(
     
  10. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Yes, that sounds normal; why the sad face?

    --Eric
     
  11. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,966
    The massive spike is Mono compiling at full speed. Would you prefer it didn't try to use all your available resources? What would be the point behind a fancy processor and large quantities of memory if your computer wasn't able to use it all?

    I simply don't understand this type of logic some people seem to have. It's a good thing for it to do this.
     
  12. ababab5

    ababab5

    Joined:
    Apr 15, 2014
    Posts:
    508
    I understand your point, it's because I didn't mention something : it takes 1 to 3 minutes each time i change something in my code... :(
     
  13. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,966
    Ah. Now that I don't know anything about. Changing scripts does have a little blip for me, but it's only a few seconds.
     
    ababab5 likes this.
  14. ababab5

    ababab5

    Joined:
    Apr 15, 2014
    Posts:
    508
    It should be great to have a console to see what unity do :(

    I take a screenshot of my logs in the activity monitor :

    Capture d’écran 2015-09-16 à 17.52.21.png