Performance ananlysis

Started by
7 comments, last by Adam_42 12 years, 10 months ago
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.

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max, Watch Dogs: Legion

Advertisement
I don't know how well it meshes with the XNA library, but last time I had to do .NET profiling, Ants from Red Gate served me well.
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

Never say Never, Because Never comes too soon. - ryan20fun

Disclaimer: Each post of mine is intended as an attempt of helping and/or bringing some meaningfull insight to the topic at hand. Due to my nature, my good intentions will not always be plainly visible. I apologise in advance and assure you I mean no harm and do not intend to insult anyone.


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

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.

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max, Watch Dogs: Legion


[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

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

Never say Never, Because Never comes too soon. - ryan20fun

Disclaimer: Each post of mine is intended as an attempt of helping and/or bringing some meaningfull insight to the topic at hand. Due to my nature, my good intentions will not always be plainly visible. I apologise in advance and assure you I mean no harm and do not intend to insult anyone.

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.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.


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.

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.

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max, Watch Dogs: Legion

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.
Always strive to be better than yourself.
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.

This topic is closed to new replies.

Advertisement