Search Unity

Have to wait 20s after change a word in script

Discussion in 'General Discussion' started by NoobCoderFake, Aug 18, 2018.

  1. NoobCoderFake

    NoobCoderFake

    Joined:
    Nov 24, 2015
    Posts:
    42
    After change even a single word in script, unity editor get stuck for about 20 seconds, as follow:
    profiler.png

    I've almost lost my job as it's so slow. So anybody knows how to fix it?
    My CPU is I5-6400, with 12GB RAM, 250GB SSD. Hardware shouldn't be the problem.
     
  2. DoctorShinobi

    DoctorShinobi

    Joined:
    Oct 5, 2012
    Posts:
    219
    Start using Assembly Definition files.
    Also, you might want to try Unity's new(experimental) Incremental Compiler and see if it also helps.
     
    TonyLi likes this.
  3. Amon

    Amon

    Joined:
    Oct 18, 2009
    Posts:
    1,384
    Do you have any Security Software installed that might interfere with Unity? I know from personal experience as it happened to me. I had AVG Internet Security installed with all the bells and whistles; behavior analyzer, behavior blocker, real-time detector etc. When I disabled the behavior blocker/analyzer the issue was resolved. In the end, I added the entire unity directory, including the work folder to AVG's exception list which prevents it monitoring and interfering with anything unity does.

    You may want to try that and report back.
     
    NoobCoderFake and Kiwasi like this.
  4. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,769
    This has been talked many times over and been concerns, that this actually may not help to speed up at all.
    SSD may help, but also not guarantee.
    Major thing, is to use proper folder location in your asset folder. There are certain folders, like Standard Assets, which don't update, when game starts, or you edit scripts, located outside this folder.

    If you want do certain renames, I found useful of doing either in VS, or outside unity. When happy with changes, then run refresh. There is also auto update somewhere (I forgot), when editing scripts. Disable it, and refresh explicitly, when going back to editor and need it to refresh (typically Ctrl+R)
     
    NoobCoderFake likes this.
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,692
    I agree with DoctorShinobi about using Assembly Definition Files. Regardless of hardware, it's faster to completely skip compiling something if it hasn't changed.

    However, the message "Unaccounted time between AssetPostprocessingInternal..." suggests it might instead be a faulty or slow-running asset postprocess script, although it could still be the compile stage. Expand the Overview column to get a better idea of where the time's going.

    Related to Amon's good suggestion about antivirus, also make sure you're not trying to run your project in an auto-syncing folder such as a Dropbox or OneDrive folder. This can slow it down quite a bit.
     
    NoobCoderFake and Kiwasi like this.