Scrolls from the past: Profiling
Because sometimes old things never gets old, and valuable knowledge gets lost with the passing of time, it is best to bring it back to attention, so that young generations can benefit from those that came before them. This week, we'll unearth a couple of scrolls talking about profiling your XNA games.
Let's start with the spring of 2007 (Year 1 of the Age of XNA). As brave programmers started using XNA, they started to worry about the effects that this new form of magic would have on their surroundings, which had to be kept free of residual energies (a.k.a. garbage). People were most worried about the foreach spell, rumored to generate such energies. Thus, the mighty wizard Eli looked into the problem, and wrote two scrolls on how the foreach spell is better used, but most importantly, he left us notes on how to investigate such problems ourselves, through a ritual called memory profiling, using the CLR Profiler, and the XNA Framework Remote Performance Monitor for Xbox 360. These two scrolls can be found and read in Eli's book here and here.
At the same time, another XNA apprentice wrote about a related ritual called CPU profiling, through which other XNA apprentices could learn why their creations were slow, and lazy, by using a tool called NProf. Those that want to can still read Thomas Aylesworth's writings here.
Over a year later, bittermanandy was writing a chronicle about what recipes and rituals he found most useful in his delvings into XNA, and in one of these chronicles, he touched on the subject of the CLR Profiler again. That same year, jwatte gave away a free potion that could be used for performing the profiling ritual in the kingdom of the Xbox 360, which was not possible using NProf. MJP made a comparison between events and virtual functions, using the Stopwatch spell, and left his writing for all to read in one of his scrolls.
More recently, in Year 3 of the Age of XNA, the Grand Master Wizard Shawn, reminded all of us how important is that we use the profiling rituals as often as possible, and gave us an example of using the blunt yet powerful spell Stopwatch.
We hope you liked our return to past scrolls of wisdom, and found something of help in them. Please let us know what you think, and leave a note in the notebook below.