Search Issue Tracker

Fixed in 2021.1.X

Fixed in 2019.4.X, 2020.3.X

Votes

0

Found in

2019.4

2020.3

2020.3.21f1

Issue ID

1385373

Regression

No

The performance of AddComponent degrades when Scripts are generated in previous opened instances of Editor

Scripting

-

Reproduction steps:
1. Open the attached project "AddComponent_2020.zip"
2. Switch the platform target to Android, and enable Development Build
3. Build and Run on the project on a device
4. Open the Profiler window and attach it to the Android process running on the device and monitor the CPU usage module with the Timeline view selected
5. Select the 'Start' button on the screen of the device and wait until the button will be replaced from "Start" to "Reset"
6. Pause the process in the Profiler and notice a spike on the Timeline
7. In the Profiler locate the 'InnerComponent' AddComponent calls and note the time each one takes
8. Close the Profiler and in the Editor navigate Assets folder > GeneratedScripts folder
9. In the GeneratedScripts folder select all scripts and delete them
10. Close and re-open the Editor
11. In the top toolbar click Benchmark > Generate 5000 Scripts and wait for the process to generate scripts in the GeneratedScripts folder
12. Go back to the Assets folder and open "AddScene.unity" Scene
13. In the Hierarchy window select "GameObject"
14. In the Inspector window add the missing "MainFile.cs" script in the Script component from the GeneratedScripts folder and save the Scene
15. Repeat 2 - 7 steps, notice that the "InnerComponent" AddComponent calls take much less time
16. Close and re-open the Editor
17. Repeat 2 - 7 steps, notice that the "InnerCompoent" AddComponent calls take more time again

Expected result: AddComponent calls will take the same amount of time whether the scripts are new to that editor instance or not
Actual result: AddComponent calls take longer if some project scripts were not created in this editor instance

Reproducible with: 2019.4.34f1, 2020.3.25f1
Not reproducible with: 2021.1.16f1, 2021.1.28f1, 2021.2.7f1, 2022.1.0b1

Tested the issue with:
VLNQA00147 - Razer Phone (Cheryl), OS: 8.1.0, CPU: Snapdragon 835 MSM8998, GPU: Adreno 540

  1. Resolution Note (fix version 2020.3):

    Fixed in: 2020.3.31f1

  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.