Adventures in Performance II: Profiling
Cubed2D brings news of part two in a series on Profiling in XNA games. In this article Cubed2D goes over what profilers are, how to create them as well as how to use them efficiently. Sample code is introduced in the form of a game that spits out triangles and spheres with the profiler output displayed to the window. Be sure to check out the first article on FPS and Frame Time.
I have done a followup article to my last article on performance, this time discussing how to implement an in game profiler, to help you find out how your code is performing. Its a great way to find out how many times something gets called or how long the game spends in each piece of code each frame and other things like that!
Here is a snippet from the article:
First of, whats a profiler? A profiler is a tool that can tell you what your code is actualy doing. It tells you how much time it spends in each piece of code. You can get external programs which can profile your .Net application. So why bother writing our own? because games are different to office applications! We want to know what our game is doing frame by frame. External profilers will sample your game application over a few seconds and tell you what happend over thoese seconds, we want to know what happend on a frame by frame basis.
So, what should the profiler be? The profiler component should collect every imaginable piece of data about how the game is currently running, it should include stuff we might want accessible in any game build (I always like to have FPS and Frame Time easily accessible in pc games) and stuff we might want to use in ‘profiling’ builds, like a print out of exactly which pieces of code are being called, how many times they get called and how they relate to another (execution hierarchy). Basically I want to be able to get code to compile into a build of my game which will print out what my game is doing.
Read the full article on Neocake Notepad: Adventures in Performance II: Profiling

No comments
Jump to comment form | comments rss [?] | trackback uri [?]