Search Unity

trivial source code change takes 95 seconds to refresh asset database

Discussion in 'Asset Database' started by Arcanor, Jan 23, 2018.

  1. Arcanor

    Arcanor

    Joined:
    Nov 4, 2009
    Posts:
    283
    I'm a unity pro user, and working on a large project that I'm trying to keep small enough to be able to work with. But I'm having major problems with delays after every change to the source code. Even trivial changes like modifying one single character inside a comment.

    When I run the profiler, I select Profile Editor, then hit Record. Then I go to visual studio (all scripts are C#), and make a one character change in a comment, save the file, return to the unity editor, and wait while the spinny icon (not much spinning actually) tells me that unity is refreshing the asset database. As soon as the icon goes away, I unclick the profiler Record, and look at the suspect frame.

    What I see is in the CPU Usage -> EditorCompilationInterface.TickCompilationPipeline() -> Self ms == 94190.38.

    Yes, I did wait those 94 seconds for unity to refresh after changing one character in a comment. This happens consistently!

    How can I identify what's wrong with my project so I can make the unity editor usable again?
     
  2. Arcanor

    Arcanor

    Joined:
    Nov 4, 2009
    Posts:
    283
    Can the profiler tell me which classes are taking so long to compile? I tried "Deep Profile" but it failed and couldn't receive all the data from the long frame.
     
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
  4. Dave-Carlile

    Dave-Carlile

    Joined:
    Sep 16, 2012
    Posts:
    967
    What @Joe-Censored said. Also, if you have many assets in a Resources folder, those are all processed during each build and can take a long time if there are a lot of them. In that case you should look into using asset bundles if you need to load things at run time.
     
  5. Arcanor

    Arcanor

    Joined:
    Nov 4, 2009
    Posts:
    283
    @Joe-Censored - thanks I will take a look at that page.

    @Dave-Carlile - I will look to see what I can remove from Resources folders. I am bringing most assets in already via AssetBundles, but the base client project is the one I'm having issues with. That's where I keep all the scripts and other common things like UI, fonts, icons, etc.