Are there any forums here dedicated to helping answer Unity profiling questions? I’m trying to understand the results of a profiling session, but not sure where to best ask questions.
Thanks
Are there any forums here dedicated to helping answer Unity profiling questions? I’m trying to understand the results of a profiling session, but not sure where to best ask questions.
Thanks
Right now it’s a huge: It depends…
Try narrowing it down to an area where your issues probably lie and post it to a subforum that is most likely to have people that monitor/frequent that subforum that would know something about it:
Thanks for the detailed response. My questions are more along the lines of how do I interpret what the profiler is showing me and then use that information to zero in on the cause of my problems?
As an example, I am getting periodic “hiccups” in the rendering of my Quest 2 application where the frame timing will basically double for a single frame and then run fine for the next 100 frames or so before repeating. The corresponding call trace in the hierarchy view shows the excess time is being spent in PlayerLoop → PostLateUpdate.PlayerSendFrameStarted-> FrameEvents.XRBeginFrame → Gfx.WaitForRenderThread → Semaphore.WaitForSignal. So, while I understand that basically means what it says (i.e. the app is waiting for something to complete), I have no idea how to determine exactly what is causing the condition. My hope is that there is more in the profile results that can lead me to a specific root cause, but I am unsure how to go about getting at that info.
In any case, I will definitely spend some time visiting the 2 documentation pages you linked and see if that helps me progress. Thanks again.
You are welcome and yes, that sounds like a familiarly confusing situation many find themselves in, particularly when focusing on this via the Hierarchy view, which really doesn’t help much when trying to understand issues within the frame rendering pipeline. The Common Marker page does hint towards using Timeline View to understand these samples and that frame pipeline is explained a bit in this Unity Now video on Profiling as well as this blog post.
Granted the profiler should do a better job at redirecting to Timeline view for these markers, or just generally better highlight CPU Main thread vs CPU Render Thread vs GPU boundness and how these all interact with each other to construct the frame and therefore main thread time/frame rate. I really hope we can fix up some of that confusion right in the tool going forward
BTW, I think in your case and, after digging a bit into these resources, I’d hazard the guess that you might find the best place for a more detailed examination of the results to fit well into the XR or SRP subforums.
Much appreciated! Thanks for the additional resources.
One more quick question just to confirm I am on the right track.
I’ve watched the video on profiling which was a great help. However, diving into the Timeline View it doesn’t seem to follow what was presented in the video, mainly, that waiting in one thread should correspond with activity occurring on another thread (at least that was my understanding).
In the below screengrab of my latest profiling session, I do not see the activity in the Render Thread which the Main Thread is supposedly waiting on as indicated by Gfx.WaitForRenderThread. I was expecting to see a bar in the Render Thread in parallel with the Main Thread during the wait. Am I misinterpreting what I am seeing or is my understanding incorrect?
Is that the first frame you profiled? It doesn’t look to have or at least display any data from the previous frame. And the calls that this code is waiting on to finish are those started in the previous frame.
So if there should be data in the previous frame, then that’d be a bug in the Timeline UI and worth a bug report. In that case, you could go back a frame to see the Render thread timings displayed there and see what it waited on.
I found that after saving the profile to an external file, then reloading back into the profiler, the Render Thread now shows data (PlayerEndOfFrame in my case) in the same frame which was previous empty. If I find this behavior continues, I will submit a bug report. Thanks.