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
- User is not notified of unsupported behavior (nested SetParent)
- TMP Text size does not adjust after Superscript Rich Text tag when using Fallback fonts
- Unexpected behaviour when selecting items in UI Toolkits TreeView sample
- C# Script Help button leads to missing documentation
- Root GameObject behaves differently when blending animations with and without keyframes and using AnimationPlayable
Resolution Note (fix version 2022.1):
Fixed in 2022.1.0a16