Search Issue Tracker
Fixed in 2022.1.X
Votes
1
Found in
2018.4
2020.2
2020.2.0b5
Issue ID
1282612
Regression
No
Unused prefab data not being cleaned when removing script through override
Reproduction steps:
1. Create new project and import Script2
2. Create an empty Gameobject and add the Script2 component
3. Make the Script2's array be 10,000 in length
4. Turn the Gameobject into a prefab
5. Press randomize on the prefab instance in the scene (creating 10,000 prefab overrides) and save the scene
6. Open the prefab, then delete the Script2 component
7. Save and exit the prefab editor
8. Observe the performance of the original prefab by moving and undoing
Expected result: Unused data gets cleared
Actual result: Prefab retains unused, unreachable data slowing down performance
Reproducible with: 2018.4.28f1, 2019.4.11f1, 2020.1.8f1, 2020.2.0b6
Notes: Seems to also be caused by:
- Commenting/removing the array in the script.
- Changing the array length in the prefab
- Changing the array length in the instance
- Removing the script in the instance (creating a removal override)
Array size should be increased if prefab performance difference is not noticeable
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note (fix version 2022.1):
Fixed in 2022.1.0a16