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
Comments (1)
-
PutridEx
Oct 06, 2021 05:56
The state still says active even though the note says it's fixed.
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
- WebGL Player with WebGPU Graphics API fails to render Scene when custom Render Feature is used
- “EndLayoutGroup” error thrown when changing Shader Precision Model settings in Build Profiles window > Player Settings Overrides
- Button hover state uses default theme color when a custom .uss is applied
- Samples Showcase script warning does not clear after enabling required settings until GameObject is reselected
- VFX Particles receive shadow artifacts when using ShaderGraph with enabled shadows and Face Camera Plane Orient mode
Resolution Note (fix version 2021.1):
Fixed in 2021.2.0a14