The Fallacy of Premature Optimization
ubiquity.acm.org
ubiquity.acm.org
I've seen too much time spent optimizing a product that was destined to never find a market, and too little time spent optimizing a product whose poor performance doomed its market entry. And, having spent literally months dedicated to optimizing code, I've also seen that some code could have been easily optimized "up front", while other code would have been impossible to optimize before it was applied to real-world use cases.
Maybe, for me, the real answer is experience. It takes experience to recognize that the market you are in, and the particular problem you are solving, and the approaches you are taking to solve the problem cannot be underestimated - they must be understood as much as possible because they ultimately determine the definition of "premature optimization".