Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you're worried that garbage collections are impacting performance, one of the best tools you can learn to use is the <a href="http://www.microsoft.com/download/en/details.aspx?id=16273" rel="nofollow">CLR Profiler</a>. This utility allows you to profile the heap allocations performed by your program, so that you can identify which exactly methods are generating garbage. Remember that a lot of non-obvious things can allocate onto the heap: concatenating strings, indexing dictionaries with enumeration keys, closures, delegates, etc. Even a little garbage, generated once per frame at 60+ frames per second, can quickly add up under the right circumstances.</p> <p>That said, what you've described doesn't sound like a problem with garbage collection to me. The GC is generally quick enough, even during a complete collection, to only cause a few frames to be dropped -- in other words, you'll notice a minor, annoying jerk every so often, but not a persistent slowdown. </p> <p>(Caveat: this only applies on the PC, which has a very sophisticated GC compared to other XNA platforms.)</p> <p>You should try attaching a profiler to your code to identify which methods are taking the longest to complete; if your problem isn't related to GC, this may be informative. In the past, I've used <a href="http://www.eqatec.com/Profiler/Home.aspx" rel="nofollow">EQATEC</a>, although I've had issues with some of their more recent versions. You can try that one, or you can look around on Google for an alternative.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload