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

Updating assets is very slow for simple prefab hierarchies

Discussion in 'Editor & General Support' started by Hyperg, Jan 18, 2019.

  1. Hyperg

    Hyperg

    Joined:
    Jul 6, 2015
    Posts:
    19
    Hello,
    Upon the angry cries of the mob here at office, I've started to investigate the Editor logs of our staff and it seems that very simple editor operations (like duplicating prefabs with very simple hierarchies of 2-3 GameObjects) can take up to 14-15 seconds.

    The messages in question look something like:
    Code (csharp):
    1. Updating Assets/SimplePrefab.prefab - GUID: nnnxxxyyyy ...
    2. [CommitTime: 1.300159 ms]  done. [Time: 14121.816694 ms]
    We've dealt with projects a lot bigger than the one in question and never noticed this issue cropping up so aggressively.
    - Antivirus is not the cause (added the project folder as an exception just to check but the delay is similar);
    - Import compression is not the cause (the import time seems to remain around those values regardless of what asset is being imported, which is pretty weird to begin with);
    - Pretty much all the machines use cache server and are equipped with SSD-s, so I/O does not seem to be the cause either (plus that gets logged with its own cache server access message);

    My deepest thoughts of gratitude would to to some AssetImporter callbacks somewhere in the project and its various (but not many) AssetStore packages.

    Does anyone know if there are any other calls that can be tracked to editor scripts and which happen during that specific "Updating" asset moment?

    EDIT: Our editor version is 2017.4.4f1
     
  2. Hyperg

    Hyperg

    Joined:
    Jul 6, 2015
    Posts:
    19
    Update: This seems to happen for 2017.4.25f1 as well on a complete project load (as in opening the source controlled project - without a Library folder - and letting the editor "hold on" for a bit...). The bit in question is about to hit the 24th hour of import with pretty much every asset getting imported in ~12-14 seconds. The machine in question has just been set up but this seems to be inline with what's been happening for everyone in the studio.

    The project is not huge (compared to the previous one which didn't have this issue, but we didn't use Unity 2017 back then), the Assets folders is somewhere around 4.5GB.

    Did anyone spot anything in a project folder that could cause Unity to spend 12 seconds to import a 600 bytes asset?
     
  3. arjenveenhuizen

    arjenveenhuizen

    Joined:
    Jan 12, 2017
    Posts:
    5
    I happen to have ran into the same problem, though it (also) manifests itself when importing simple CS script files. For example:

    Code (CSharp):
    1. Updating Assets/Scripts/VRStandardAssets/Scripts/VREyeRaycaster.cs - GUID: ffebc012055484b4899e163803755608...
    2. done. [Time: 1096.056000 ms
    This happens on a clean git checkout, without a LIbrary folder on Unity 2018.3.0f2. What could be going on here?
     
  4. MaxEdOwl

    MaxEdOwl

    Joined:
    Mar 25, 2019
    Posts:
    1
    I found a potential reason in Unity 2018.1 (and maybe later versions) for this using a profiler. It seems that during these long imports the library Unity uses to load YAML files slows down to a crawl for some reason, with yaml_parser_load taking 90% of CPU time. Also, system's memory usage can get really high (30Gb in my case).

    This all points to a possible memory leak in LibYAML, and indeed, killing Unity and restarting it (the import process continues from where it finished last) sped the process up considerably, with no more slowdowns. LibYAML's GitHub Issues page contains a few reports of memory leaks, so this seems probable, though I don't know which version Unity uses, and if it is modified by Unity team.
     
  5. Kenthria11

    Kenthria11

    Joined:
    May 6, 2017
    Posts:
    19
    This still occurs in 2020.1. Over an hour to import my project on startup and refresh, seconds when prefabs are deleted. No word from Unity?
     
  6. pavelzinov42

    pavelzinov42

    Joined:
    Feb 10, 2017
    Posts:
    3
    Can confirm. Happens all the time on 2018.4.22f1
    We use build server for building our branches and the very same branch that we already used for building (basically Library stays the same) can open in batch mode for about an hour or so because of slow
    Updating Assets/Resources/XXX.prefab messages

    However sometimes it opens up in 16 minutes. On my local machine this process takes 2 minutes.
     
  7. darthdeus

    darthdeus

    Joined:
    Oct 13, 2013
    Posts:
    76
    Is this possibly related to the AssetDatabase.Refresh being slow in v2?