Search Issue Tracker
Fixed in 2021.1.X
Votes
1
Found in
2020.1
2020.1.2f1
2020.2
Issue ID
1272168
Regression
No
Slower performance of Instantiate() when using it in a build compared to the editor
How to reproduce:
1. Open user's attached "BugReport" project
2. Open Assets/Scenes/StartScreen
3. Enter Play Mode
4. Press the "Generate Chunks" button in the Game View window
5. Wait until the chunks are generated
6. Open the projects directory and open the temp.txt file
7. Observe how much time each chunk took to generate
8. Build the project
9. Run the build through the build's directory
10. Press the "Generate Chunks" button in the Build
11. Wait until the chunks are generated
12. Open the temp.txt file in the build's directory
13. Observe the difference time difference in the build and the editor
Expected result: It takes the same amount of time to instantiate a chunk in the Editor and in the Build
Actual result: It takes about 10 times longer to Instantiate a chunk in the Build
Reproducible with: 2020.1.5f1, 2020.2.0b3
Can't reproduce: 2018.4.27f1, 2019.4.10f1 (can't downgrade the project)
Notes:
- The temp.txt file contains the amount of time (ms) each chunk took to instantiate calculated using System.Diagnostics.Stopwatch
- Reproducible with Windows and Mac standalone builds
- Could not reproduce the slow performance by instantiating about 100000 cube prefabs
- I suspect the issue might be caused by Instantiating a large number of big prefabs
- You can see what kind of object the user is Instantiating by opening Assets/Prefabs/Chunk prefab and viewing the elements of "All Possible Objects" public variable
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
- [Silicon] Artifacts appear in the Game view when resizing the window/entering the Play Mode in a specific project
- Marker in the animation’s preview window doesn’t stop when reaching the end of the timeline and jumps to the start of the animation when moving it with the cursor
- Animation Event marker is not placed on the current time of the timeline when using the “Add Event” button
- Editor crashes on vector_map<ConstantString,AssetBundle when using the LoadAssetAsync function
- Fetched files in Perforce are automatically added to the change list when they are serialized
Resolution Note (fix version 2021.1):
Fixed in 2021.2.0a14