Sign in to follow this  
NightCreature83

Performance ananlysis

Recommended Posts

NightCreature83    5002
Is there any tool out there that allows you to analysis a XNA/.NET application on a per frame basis, so something like SN Tuner for PS3 or PIX for Xbox. I am interested in which functions get hit the most on a per frame basis as I am seeing frame drops and I would like to see where they come from. Or is there a tutorial for a tool somewhere that allows me to setup the data analysis in such a way that I get to see what is happening per frame.

To make this clear I am not really interested in seeing which draw calls are being dispatched I am interested in what the rest of the application is doing and what percentage of the frame time it is taking.

Share this post


Link to post
Share on other sites
ryan20fun    2634
what about PIX ?
it comes with the DirectX SDK.
i messed around with it once and it seamed to be able to debug and moniter etc in high detail.
works with any DirectX based Game / App / anything that renders with DirectX

Share this post


Link to post
Share on other sites
NightCreature83    5002
[quote name='ryan20fun' timestamp='1306306130' post='4815471']
what about PIX ?
it comes with the DirectX SDK.
i messed around with it once and it seamed to be able to debug and moniter etc in high detail.
works with any DirectX based Game / App / anything that renders with DirectX
[/quote]
As I said in my starting post I am not interested in GPU profilling in this case it is frame synced CPU profiling I am after. As I am only seeing certain frame drops at some frames the work is most likely done at the CPU side and not the GPU side.

SN Tuner lets you specify a frame swap function which it will use to base it's timings on and organise the collected data in such a way you can pick a frame bar that is over the desired time for a frame and get CPU profiling infromation from it, I would like to have a similar tool for PC if it exists.

I'll give ants a go later tonight to see if it has what I need thanks for the suggestion.

Share this post


Link to post
Share on other sites
ryan20fun    2634
[quote name='NightCreature83' timestamp='1306314579' post='4815506']
[quote name='ryan20fun' timestamp='1306306130' post='4815471']
what about PIX ?
it comes with the DirectX SDK.
i messed around with it once and it seamed to be able to debug and moniter etc in high detail.
works with any DirectX based Game / App / anything that renders with DirectX
[/quote]
As I said in my starting post I am not interested in GPU profilling in this case it is frame synced CPU profiling I am after. As I am only seeing certain frame drops at some frames the work is most likely done at the CPU side and not the GPU side.

SN Tuner lets you specify a frame swap function which it will use to base it's timings on and organise the collected data in such a way you can pick a frame bar that is over the desired time for a frame and get CPU profiling infromation from it, I would like to have a similar tool for PC if it exists.

I'll give ants a go later tonight to see if it has what I need thanks for the suggestion.
[/quote]

your right , it only deals with the GPU side, strange :huh: i thought it did CPU as well

Share this post


Link to post
Share on other sites
mhagain    13430
Nonetheless. It seems to me that you're at an early stage in this analysis and don't yet know precisely where your perf drops are coming from. True, you have a hunch to work on, but it does remain a hunch, and you could end up investing a lot of time and effort in CPU-side analysis. Is there really any harm in using PIX to confirm your hunch? Even if all it does is confirm that you're not bottlenecked GPU-side, it's still useful information - you've definitively ruled something out.

Share this post


Link to post
Share on other sites
NightCreature83    5002
[quote name='mhagain' timestamp='1306317380' post='4815517']
Nonetheless. It seems to me that you're at an early stage in this analysis and don't yet know precisely where your perf drops are coming from. True, you have a hunch to work on, but it does remain a hunch, and you could end up investing a lot of time and effort in CPU-side analysis. Is there really any harm in using PIX to confirm your hunch? Even if all it does is confirm that you're not bottlenecked GPU-side, it's still useful information - you've definitively ruled something out.
[/quote]
I already know how to use PIX and do use it I just want an additional tool that allows me to do a similar thing on CPU side.

Share this post


Link to post
Share on other sites
landlocked    103
You may need to write your own handler for this. You could also use log4net and output a log entry for, say, "STARTING DRAW FRAME {timestamp}" and outputting to the log on each method call by inserting a log() call on the first line of your methods, so, for example "Call RenderSprite {timestamp}." Other than this you could use reflection but that's painfully slow for something like a game.

You would have to aggregate the data yourself if you use log4net if you want to know simply how many times they are each being called. I included a timestamp in my examples as it may also highlight where you'd want to optimize if the next method is simply taking too long to be called and will also show you any interesting behavior if you have multithreaded processes firing away.

Share this post


Link to post
Share on other sites
Adam_42    3629
The latest version of Intel's VTune allows you to add frame markers via an API (supposedly it also works automatically in some cases, but that didn't work for me). It also has a free 30 day trial.

What I'd go for is drawing you own visual profiling data though. Record high precision timer values at various points through the frame, and at the end draw them as bars on screen. See which one spikes when you get your frame rate hit. You can then subdivide the positions of the timers as necessary to isolate the exact cause.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this