More detailed Microprofiler sublabels under Present

image

15ms? What’s up with that

As a developer I want to know what’s taking a whole frame to do

7 Likes

Having more detailed sublabels in the microprofiler would make finding inefficient code / bugs a lot easier than it is currently.

Present is probably just a call to the SwapChain. It’s taking nearly a whole frame because of VSync.

https://msdn.microsoft.com/en-us/library/windows/desktop/bb174576(v=vs.85).aspx

There are two cases why this can happen:

  1. There is a lot of GPU workload, and Present is waiting for it. There’s a separate GPU timeline available on NVidia/AMD on PC (we disable it on Intel because of some driver bugs that interfere with the client closing correctly…)
  2. The system activates VSync behind our back. We generally currently try to disable it, but there are cases where we can’t; particularly, on Mac with Metal VSync is currently enabled because there’s no way to disable it up until macOS 10.13 which isn’t live.

There’s no way for us to bisect Present further in general because all of the above happens in the OS + the graphics driver and we ourselves unfortunately have zero visibility into that.

However, note that in the case 2 above, this isn’t really doing “work” - it’s just waiting. All other processing (like scripts etc.) is executing during this, so you can think of this as throttling to 60 Hz as opposed to “it takes 15 ms to do smth”.

TL;DR: It’s probably taking a whole frame to wait for the start of the next frame.

2 Likes

Worth noting is that I’ve recently noticed that on Windows 10 on my laptop Present started acting as if it’s in true VSync mode; curiously, switching to Fullscreen and back disables this. No idea why - we don’t do anything to facilitate that :frowning:

1 Like