Idris Halloran
Software engineer, Edinburgh
When a page is slow, the first suggestion is usually a bigger machine. It is rarely the cheapest fix and almost never the first one to try.
Trace one request
Pick a single slow request and follow it from the click to the last byte. Write down every hop and how long it took. On Fernhill's checkout that list had eleven lines, and three of them were the same lookup.
Delete before you tune
The fastest query is the one that is not sent. Most of the 840 milliseconds went on work whose answer was already in memory two functions up the stack.
Keep the ruler
Leave the measurement in place when you are done. A number that is on a screen every morning tends to stay where you put it.