Coding Horror

programming and human factors

Troubleshooting .NET performance using Peanut Butter

Here's some excellent, concise advice on troubleshooting performance in managed code. It all starts with peanut butter, naturally:

My last entry was some generic advice about how to do a good performance investigation. I think actually it's too generic to be really useful -- in fact I think it fails my Peanut Butter Sandwich Test. I review a lot of documents and sometimes they say things that are so obvious as to be uninteresting. The little quip I have for this situation is, "Yes what you are saying is true of [the system] but it's also true of peanut butter sandwiches." Consider a snippet like this one, "Use a cache where it provides benefits," and compare with, "Use a peanut butter sandwich where it provides benefits." Both seem to work... that's a bad sign.

As promised, Rico then provides a prescriptive list of windows performance monitor counters with comments indicating what the values should look like in a healthy app. He also linked to another blog post with a bit more detail specific to .NET memory performance counters which is also worth reading through.

Written by Jeff Atwood

Indoor enthusiast. Co-founder of Stack Overflow and Discourse. Disclaimer: I have no idea what I'm talking about. Find me here: