Jump to content
  • Advertisement
Sign in to follow this  
SteveS1949

Performance analysis and refactoring (debugging Present())

This topic is 2454 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all,

I have refactored my app architecture a tad, but the core code remains very similar (certainly the D3D bits). Before I was running at 220FPS, now Im down to 27FPS :S

I have perf'd the app, and Its biggest 'hang' is on swapChain->Present(). I realise this could be waiting for GPU but Im unsure how to check and perf whats going on.

Any ideas would be greatly appreciated :)

Steve

Share this post


Link to post
Share on other sites
Advertisement
Are you doing any readbacks from gpu / syncs in between cpu and gpu? If so, even seemingly small changes in where /when these occur can kill framerate. Especially on sli systems.

Share this post


Link to post
Share on other sites
Isn't Present() when the GPU and DirectX are "doing stuff", and is thus a very bad indicator of actual performance? Have a look at the first section on the following page: http://tomsdxfaq.blogspot.com.au/2006_04_01_archive.html#114482869432550076#114482869432550076

At a guess I'd say in your new architecture you're accidentally recreating resources over and over. What sort of scene are you rendering?

Share this post


Link to post
Share on other sites
You should check first, if you're CPU or GPU bound. The number of batches send to the GPU is still a bottleneck. When not using some fancy vertex/geometry shading, pixel shading is most probably a bottleneck on the GPU. A simple test is, reduce the resultion. Check your performance on different resolutions (160x100, 320x200,....1600x1000). When your bottleneck is the CPU, you will have almost constant fps at most resolution levels, when you perfomance increases a lot while reducing the resolution, you are GPU bound.

In general, when waiting for swapping buffers, the CPU will busily wait until the GPU has rendered everything.

Btw., fps is a bad measurement, try to check your milliseconds to get a better, linear feeling of performance.

Share this post


Link to post
Share on other sites

Btw., fps is a bad measurement, try to check your milliseconds to get a better, linear feeling of performance.

I keep falling into this trap myself, even though I read that ms is a better metric and changed my debug display to show ms as well as fps, I keep checking the fps whenever I do any optimisation... Such a hard habit to break! :)

Share this post


Link to post
Share on other sites

You should check first, if you're CPU or GPU bound. The number of batches send to the GPU is still a bottleneck. When not using some fancy vertex/geometry shading, pixel shading is most probably a bottleneck on the GPU. A simple test is, reduce the resultion. Check your performance on different resolutions (160x100, 320x200,....1600x1000). When your bottleneck is the CPU, you will have almost constant fps at most resolution levels, when you perfomance increases a lot while reducing the resolution, you are GPU bound.

In general, when waiting for swapping buffers, the CPU will busily wait until the GPU has rendered everything.

Btw., fps is a bad measurement, try to check your milliseconds to get a better, linear feeling of performance.

This would be true if it was a drop from, say, 220 to 200/180/150/etc. From 220 to 27 (an increase of ~32.5 ms per frame, from ~4.5) is highly indicative of something else badly wrong, over and beyond the traditional troubleshooting steps.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!