Check out Paul Vick's ten rules of performance. It's very interesting read, even though it won't tell you how exactly to speed up a particular chunk of code.