Search Unity

Compiling time question

Discussion in 'Scripting' started by hgulgen, Dec 14, 2018.

?

What is your compile time ?

  1. 0-5

    5 vote(s)
    33.3%
  2. 5-15

    6 vote(s)
    40.0%
  3. 20-30

    1 vote(s)
    6.7%
  4. 30-40

    2 vote(s)
    13.3%
  5. 40-50

    1 vote(s)
    6.7%
  6. 50-100

    0 vote(s)
    0.0%
  1. hgulgen

    hgulgen

    Joined:
    Nov 29, 2016
    Posts:
    31
    Hello guys ,

    I want to ask a question as designer. When ever I change a line code save and return to unity I'm waiting 30-40 sec. My project size is like 10 gb. alot of models and textures 1844 scripts with all plugins. I locate my scripts in Standart asset folder. Plugins are in Plugins folder. I use assambly files for in script folder under all categories. My auto refresh is turn off , Because asset update is really pain for me When ever When I go another windows app , then return back , Unity check all assets. It is long time for me, I hate Auto refresh and close it but know Whenever change code, I am waiting for 30-40 sec. I update manually. Is this normal proccess or any idea or tips How can I reduce this time. I try assembly files but nothing happen. Please help me :(
     
  2. FMark92

    FMark92

    Joined:
    May 18, 2017
    Posts:
    1,212
    Where are 'above 100' options? Or are the listed values already in hours?
     
  3. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    2,119
    I'm not sure compile time is related to the size of the project.

    It must take about one or two seconds for me.
     
  4. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    4,566
    I generally see no more than a few seconds no matter the project.
     
  5. hgulgen

    hgulgen

    Joined:
    Nov 29, 2016
    Posts:
    31
    @Brathnann @AnneSchmidt Thanks for answer. How can I detect which part of code compile take too much time ? Do you have any idea ? Profiler can find compile time ?
     
  6. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    2,119
    Maybe it's not the compiler but your computer?
     
  7. hgulgen

    hgulgen

    Joined:
    Nov 29, 2016
    Posts:
    31
    @AnneSchmidt I have Core i7 4770k cpu , I dont think is depending on computer.
     
  8. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    3,736
  9. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    2,119
    If depends on how busy your computer is when you have a new script to compile. :)
     
  10. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    2,960
    CPU speed always matters. For large projects with lots of source files disk speed matters too. In Unity there are additional things to compile, like shaders, and a lot of things which may have recompression trigger, like textures and sound. Doing so in parallel saves time, but doing things with large files in parallel costs disk performance, so a good SSD is key. The more cores you have, the more you need that SSD.

    There's another thing which can slow down compilation immensely: Log output. Printing lots of warnings could actually double compilation time if they're scattered all over your code. Everything stops when printing, and doing it thousands of times has a significant impact. In other words: Write clean code and fix every warning. Microsoft have mentioned this in their Visual Studio documentation, and it holds true for Unity too.
     
  11. hgulgen

    hgulgen

    Joined:
    Nov 29, 2016
    Posts:
    31
    @orb Thanks for your answer. My project is already in ssd disk but you said like I have 290 warning and I ignored all the time I will fix them. I hope it will be fix the speed. Thanks If I gain a speed , I will write here
     
  12. Suddoha

    Suddoha

    Joined:
    Nov 9, 2013
    Posts:
    2,401
    Never seen extreme compilation times, and we're having a big code base at work. Though the code base is seperated into assembly files and we're only working directly in the project's code on new features. It doesn't take long to make any changes, 1 or 2 seconds until Unity starts and another 2 or 3 seconds to complete.

    Perhaps it is caused by lots of instances of the scripts, that have to be adjusted. I mean, for all the types that have been changed, the serialization layout could have changed and thus all instances have to be serialized again, in order to support the changes.

    Just for testing purposes, it might be worth creating a new project. Throw all the assets and scripts from your original project in, and make a change in the scripts. If that runs significantly faster, the scene updates + all instances may cause the extreme times you're facing.
     
    Last edited: Dec 15, 2018
  13. hgulgen

    hgulgen

    Joined:
    Nov 29, 2016
    Posts:
    31
    I try to delete folders then realize , There are a lot of empty folders in my project , I clean them and now it is better performance, I think when I change something , Editor search all folders. This take some times. It is better now but It still is not perfect. I will update more here If I find usefull information , for next generations.
     
  14. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    5,705
    When I change a script file and head back to the editor it normally takes between 5 and 15 seconds depending on which computer I'm on. In my project if I switch between platforms (windows to linux, or x86 to x86_64) I'm looking at 10+ minutes, 20+ on my laptop. If I delete my library folder I'm looking at 25 minutes on my desktop and an hour on my laptop.