Search Issue Tracker

Fixed in 2021.1.X

Fixed in 2019.4.X, 2020.3.X

Votes

1

Found in

2018.4

2019.4.2f1

2020.2

Issue ID

1278548

Regression

No

Performance decreases with a large number of components when AddComponent is used

Scripting

-

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

  1. Resolution Note (fix version 2021.1):

    Fixed in 2021.1.0a1.495

  2. Resolution Note (fix version 2019.4):

    Fixed in: 2019.4.37f1

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.