But that's not the first port of call. For instance, I've worked with a few companies that were perplexed why their site was going slow when they had invested heavily in great servers. It turns out the code was terrible.
The reason I posted the quote was to answer your on your remark that it isn't a solution - it is close to an ideal solution actually, but not applicable everywhere and at any time (e.g. sloppy/non-optimized code as you pointed out).
Hope this makes sense.