Slow prefab loading issue
Prefab loading speed from resources depend on total number of graphics in resources.
In our game we do use prefabs, which contain a large number of sprites. From 20 to 100 sprites per each prefab. All of this sprites, which used for each prefabs - are packed in atlas with sizes like 1024x1024, 2048x2048, 1024x2048, 512x2048, etc.
These prefabs are in Resources directory. Loading in runtime by pressing button through: GameObject loadedItem = Resources.Load(path);. Sprites and atlases are out of Resources directory.
By increasing graphic assets number we noticed that prefab loading time is also growing.
For example: we have prefab which loads in 1.51 - 1.48 seconds, which is unaccptably for our game. But if I'll remove all sprites and sprite-atlases, excluding only sprites which used for this prefab, i will have prefab loading time like: 0.39 - 0.43 seconds.
Prefab loading speed depend not only off the atlas size and number of links used in this prefab. Also other prefab links and atlases in a project will affect loading time of this prefab. And what is interesting: different prefabs with nearly same size of atlas may be loaded in different time, difference up to 2x times.
Answer by Sfighrath · May 13, 2021 at 06:58 PM
I found this in Android build. Under Editor or iOs prefab loading is fast.
Your answer
Follow this Question
Related Questions
Prefabs Making Unity Slow? 0 Answers
GameView.GetMainGameViewTargetSize() problem 0 Answers
Entering Play mode is suddenly extremely slow 2 Answers
FBX Inspector Speed + Mask Definition 0 Answers
Profiler knurl ... 0 Answers