Search Unity

Compiling time question

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

?

What is your compile time ?

  1. 0-5

    18 vote(s)
    14.4%
  2. 5-15

    49 vote(s)
    39.2%
  3. 20-30

    31 vote(s)
    24.8%
  4. 30-40

    11 vote(s)
    8.8%
  5. 40-50

    2 vote(s)
    1.6%
  6. 50-100

    14 vote(s)
    11.2%
  1. hgulgen

    hgulgen

    Joined:
    Nov 29, 2016
    Posts:
    54
    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,243
    Where are 'above 100' options? Or are the listed values already in hours?
     
  3. Deleted User

    Deleted User

    Guest

    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:
    7,187
    I generally see no more than a few seconds no matter the project.
     
  5. hgulgen

    hgulgen

    Joined:
    Nov 29, 2016
    Posts:
    54
    @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. Deleted User

    Deleted User

    Guest

    Maybe it's not the compiler but your computer?
     
  7. hgulgen

    hgulgen

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

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,609
  9. Deleted User

    Deleted User

    Guest

    If depends on how busy your computer is when you have a new script to compile. :)
     
  10. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,037
    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:
    54
    @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,824
    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:
    54
    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:
    11,847
    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.
     
  15. Achie1

    Achie1

    Joined:
    Jan 14, 2018
    Posts:
    26
    I'm facing the same issue. Same project size, same computer. But switched from Windows 10 to Ubuntu 2019.10. Compilation takes more time. About 20 seconds. On Windows, it was 1 or 2 seconds.
     
  16. hgulgen

    hgulgen

    Joined:
    Nov 29, 2016
    Posts:
    54
    @Achie1 Hello ,I solved asset update problem. It is very weird. I formatted to windows and asset updates will ok now but
    My compile time are 60 seconds now, after a year, I am very happy with that. :) I am not programmer , I am artist and I was learning programming. I read alot of articles about assemblies. I will write spaghetti code (Somestimes unity crash while compile) and all assemblies reference each other. and my project is very big now. I dont know how to solve it but If I will have time for it I should repair all scripts and references. God bless me
     
  17. Achie1

    Achie1

    Joined:
    Jan 14, 2018
    Posts:
    26
    The same project, the same computer, On Windows 10, compilation time : 1 or 2 seconds. On Ubuntu 2019.10, compilation time : 6 or 8 seconds