For weeks now I’ve been having terrible perfomance in when running VR in the Unity editor. This issues don’t persist when I am running a build version of the game. I have a tough stomach so I’ve been ignoring the issues developing for a while but its coming to a point where it is effecting gameplay and I would like to understand why my performance in the editor is so bad and how I can fix it.
I remember a time (Feb 2020) where I was constantly hitting between 100-200fps using OVRManager. I don’t know what happened but I am left with about 45fps nowadays with occasional spikes all the way down to 15fps. The EditorLoop is only adding about 3.5ms according to my profiler, so that’s not the main issue.
What is eating up all the resources are
1.EarlyUpdate.XRUpdate
2.OVRManager.Update()
3.OVRManager.FixedUpdate()
and somtimes OVRManager.LateUpdate()
The PlayerLoop in the Profiler is because of that always sitting above 85% Total usage, with 25ms of CPU time.
Am I missing something here or why is my perfomance so bad?
From the looks of it EarlyUpdate.XRUpdate is actually the culprit here taking 9.4 ms… OVRPlugin might be take unusually long, and it might have been fixed, but other are having this same issue without OVRPlugin as well…
I created a thread about it a couple weeks ago here:
I also just submitted a bug report about it today and will post the upvote link to the above link once I’m emailed it
Turns out it wasn’t really a bug, but a frame sync feature for XR input which waits too long for the GPU frame to be delivered. 97% of the time what’s happening is that the GPU frame timing is exceeding the threshold for 1 frame’s render time (11.1 ms at 90 HZ), causing the XR plugin to wait a full extra frame to get back onto the input/frame sync from the VR headset. This used to be really hard to debug in 2020 when the profiler didn’t support GPU profiling, but it’s improved a lot since then.