Over the weekend, we rolled out a few speed improvements to the Stack Overflow engine.
First, we did a quick pass with ANTS Profiler (which is great, by the way) and identified a few places where redundant or unnecessary database queries slipped into our code. We like to do this every few months on common pages as a sanity check. We start a trace, refresh a given page 50 times, then view the hot code paths in the trace. It’s almost always database queries gunking up the works, but once in a blue moon we’ll write code so bad that it actually registers in the hot code paths. Anyway, the golden rule is to measure, then optimize, and that’s what we try to do. …