This is 2019.4.13f1.
I’m troubleshooting a performance issue we are having where we:
- Disable the camera
- Unload the previous scene
- Download textures for the new scene
- Load the new scene
- Enable the camera
- Apply the downloaded textures
The code does something like this:
EnableCamera();
Debug.Log("Camera enabled");
while (!_texturesDownloaded)
{
Debug.Log(DateTime.Now.ToLongTimeString() + ": Not downloaded yet");
yield return null;
}
Debug.Log(DateTime.Now.ToLongTimeString() + ": Downloaded");
In my logs I see:
1:46:48 PM: Camera enabled
1:46:49 PM: Not downloaded yet
1:46:49 PM: Not downloaded yet
1:46:49 PM: Not downloaded yet
1:46:49 PM: Not downloaded yet
1:46:49 PM: Not downloaded yet
1:54:55 PM: Downloaded
Notice that huge gap between the last “Not downloaded yet” and “Downloaded”. Normally it’s only 1 minute or so, but this was run using Deep Profiling in the editor which seemed to greatly increase the time. In the profiler however, I don’t see any frames that are taking that long. The only “long” frame is ~500ms. Any idea where else I can be looking to see what could be causing the slowdown?