A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Separate names with a comma.
Discussion in 'Editor & General Support' started by richardkettlewell, Jul 8, 2021.
My Unity needs 1hour+ (still not done) to load a font size change of a text
My experience on this subject using 2020.3.15f2, in case it helps anyone. I have a project I've been working on for almost 2 years now and it has been fine until about a month ago when it starting taking minutes to do many editor operations - saving prefabs, duplicating files, deleting files, etc. It got progressively worse until it starting taking over 10 minutes to save a prefab after a minor modification.
Profiling in the editor.log revealed the "Hotreload" function (not the plugin, which I don't use) was taking nearly the entire time, and after doing some reading and A-B testing it seemed this was mainly caused by using nested prefabs (I was using a LOT of them, with the worst offenders being added in the last month, coinciding with the slowdown). Note the slowdown happened even when manipulating files that were not prefabs and didn't reference them, even duplicating an image file - it seemed to be anything that triggered asset refresh or import.
The last couple of days I've been going through my prefabs and unpacking any prefabs inside them (except where it's crucial to keep them as prefabs) and it has progressively eased the issue - after only going through 20% of them it's already under 3mins for functions that were taking 10mins, so the trajectory is looking good.
I think a note should be made in the Unity manuals when they tout nested prefabs as being so useful (which they are, generally) that they are not scalable (unless fixed in later versions?) and care should be taken for larger projects.
Interesting findings! If you make a small repo bug report maybe it's an issue that can be resolved? Post here if possible so we can upvote it of course
nesting prefabs may be one explanation, that because they may get out of hand with cross referencing a lot of assets and then the editor may struggle to load the stuff in memory to keep track of it.
My case might have been further exacerbated by using a lot of ScriptableObjects that reference those prefabs, perhaps the dirty flags go all the way up the line and then back down again, forcing serialization of everything linked?
BTW I got the time-to-save down to under 40 seconds for most prefabs (still bad, but workable compared to the nightmare before), and about 3mins for the largest ones. De-nesting more prefabs will start to cut into productivity (I still have some changes that I want to propagate over many objects) so I think I will live with this balance for now.
I was plagued by this strange "Unity hold on busy for" almost every day, every little operation took 5 to 7 minutes to do, and it was no longer working, so I decided to back up the entire project and try to go back to the 2019 version