Search Issue Tracker
Fixed in 2021.1.X
Fixed in 2019.4.X, 2020.3.X
Performance decreases with a large number of components when AddComponent is used
How to reproduce it:
1. Open attached project '1278548.zip'
2. Load 'AddComponentScene' from 'Assets' > 'FunctionalTests' > 'AddComponentTest' folder
3. Play the 'AddComponentScene'
4. Check Profiler window and notice that adding EmptyComponent takes about 0.465ms and adding EmptyComponent_9999 takes only 0.149ms
5. Pause the 'AddComponentScene'
6. Go to 'Assets' > 'FunctionalTests' > 'AddComponentTest' > 'EmptyComponents' folder and move all 'EmptyComponent_<NUMBER>' scripts out of the project except 'EmptyComponent_9999'
7. Reimport all assets and reload the editor
8. Play the test scene
9. Check Profiler window and notice that adding EmptyComponent and EmptyComponent_9999 takes only 0.02ms
Expected result: The use of AddComponent should not cause performance spikes with a large number of components
Actual result: The use of AddComponent causes performance spikes with a large number of components
Reproducible with: 2018.4.27f1, 2019.4.10f1, 2020.1.5f1, 2020.2.0b2
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- Referred style sheet stays dirty after saving when using the UIBuilder
- The Height map Amplitude is not working when using HDRP/LayeredLit
- Crash on internalABP::BoxManager::prepareData when entering Play Mode
- Crash at "UnityEngine.Object:FindObjectsOfType" when quitting the Player
- Creating material variant produces errors if there is no Materials folder