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

Slow Save in Editor

Discussion in 'Editor & General Support' started by teodorklissarov, Mar 6, 2019.

  1. teodorklissarov

    teodorklissarov

    Joined:
    May 28, 2018
    Posts:
    1
    Hello,
    Recently I started a new project in Unity 2018.3.5f1. I have a list of prefabs that I randomly select from during play. It doesn't matter whether the list of prefabs is in MonoBehaviour attached to a GameObject in the Scene or it is on a ScriptableObject, whenever I add more than a few prefabs to it, the editor start saving very slowly (3 -5 seconds). If I add around 30 prefabs to the list, the saving is even slower and the for a few seconds the loading bar for importing assets is displayed. I have to say that I haven't had that issue in Unity 2018.3.0f2 while using the exact same functionality.

    After more testing, it turned out that the editor saving slows down even when adding the prefabs directly to the scene. As little as 10 prefabs create a slow saving process.

    I had an OnValidate method on the prefabs which appeared to run when saving them. Removing it did not speed up the save time.

    I have the same issue on 2018.3.7f1 and am now downloading the most current beta, to see if it is fixed there.

    Edit:

    Maybe the problem is connected in some way to https://forum.unity.com/threads/performance-when-saving-prefabs.597514/

    Edit 2:

    Unity 2019.1.0b5 doesn't solve the issue. And now I am sure this is the same problem as the one linked above. I am using a payed asset Super Tilemap Editor, which creates tiles that are hidden in hierarchy, so I didn't think about it first. So I have exactly prefabs with a lot of children which make saving slower. The strange thing remains that this also affects saving when the said prefabs are attached to a list on a MonoBehaviour or a ScriptableObject.

    Edit 3:

    More light on the subject: The same issue happens if I open many of the said "big" prefabs consecutively to edit them. It is as if the prefabs remain open in memory somewhere and Unity keeps saving them.
     
    Last edited: Mar 7, 2019
  2. andreiagmu

    andreiagmu

    Joined:
    Feb 20, 2014
    Posts:
    175
    I'm also having issues with slow saves and VERY laggy Editor in general, I'm using Unity 2019.3.0b5.

    To make sure my code (including external assets code) is optimized, I'm searching out for instances of OnValidate methods, AssetPostprocessor-derived classes, and ESPECIALLY instances of [ExecuteInPlayMode] or [ExecuteAlways] near Update methods (!).

    These kind of scripts (especially the latter) MAY be running code that DOESN'T need to run in Editor (when you move a Transform in your scene, or change some value in a prefab instance, etc.), and is just slowing it down!

    In those [Execute] cases, I'm either wrapping up code with the !Application.IsPlaying flag, or flat out deleting/commenting out that attribute.
    All that work is actually speeding up the Editor (including saves) in my case! You could try that too. :)
     
  3. Politician

    Politician

    Joined:
    Apr 27, 2019
    Posts:
    8
    I've scanned all my project scripts for these instances, including asset scripts, there's none of them.
    It seems like it slows down consequentially as you add prefabs on your scene, no matter they are active or not.
    Project is on ssd, Library folder cleaned and reimported everything. At the same time saving the actual scene via Save As takes less than second, but when it comes to modifying prefabs or saving project while your big scene is loaded (in prefab view or not) it takes like ages. If you do that from empty or small scene it saves very fast.
    At the same time, idk if it's caused by the new prefab system, as I remember it was okay when it first time appeared, but since 2018.3.4f1 and up to 2019.2 now everything work incredibly slow.

    Have you managed do solve it man? It would be great if you share your progress on this!
     
    NeoUnity and andreiagmu like this.
  4. AkhmedAbasov

    AkhmedAbasov

    Joined:
    Mar 13, 2014
    Posts:
    163
  5. Miguelfanclub

    Miguelfanclub

    Joined:
    Jun 14, 2015
    Posts:
    64
  6. SeveQStorm

    SeveQStorm

    Joined:
    May 7, 2013
    Posts:
    7
  7. Politician

    Politician

    Joined:
    Apr 27, 2019
    Posts:
    8
    Easy Save asset's manager gameobject was the reason of incredibly slow saving
     
    Last edited: Aug 2, 2020
  8. Ali17X

    Ali17X

    Joined:
    Feb 20, 2019
    Posts:
    5
    any solution?
     
  9. k72dragon

    k72dragon

    Joined:
    Oct 2, 2018
    Posts:
    5
    In easy save, turn off "Auto Add Manager to scene" and "Auto Update References" then delete Easy Save 3 Manager gameobject, it solved the slow save in editor.