Game Development Reference
You cannot teach beginners top-down programming, because they don't
know which end is up.
C. A. R. Hoare
An important of element of software development, especially when dealing with
important tools and tools that perform complex calculations, is performance and
optimization. Performance testing and optimization techniques for pretty much
every language have been around for quite some time, and developers making the
switch, or developers who are hesitant to make the switch, are worried about code
performance and not having the understanding to write optimized code. The truth
for developers worried about managed code optimizations is that much of the advice
remains the same as it did prior to the introduction of .NET and the managed
In this chapter, I will briefly cover two approaches for investigating performance
and then lead into a substantial number of considerations for writing efficient
code for the .NET platform.
There are two discrete approaches for investigating performance: white box inves-
tigation and black box investigation. Both approaches have different strengths and
weaknesses, and sometimes it is beneficial to use both approaches to conduct a
robust and thorough performance investigation.