Rushing to optimize before the bottlenecks are known may be the
only error to have ruined more designs than feature creep. From
tortured code to incomprehensible data layouts, the results of
obsessing about speed or memory or disk usage at the expense of
transparency and simplicity are everywhere. They spawn innumerable
bugs and cost millions of man-hours — often, just to get marginal
gains in the use of some resource much less expensive than
debugging time.
Disturbingly often, premature local optimization actually
hinders global optimization (and hence reduces overall performance).
A prematurely optimized portion of adesign frequently interferes with
changes that would have much higher payoffs across the whole design,
so you end up with both inferior performance and excessively complex
code.
Using prototyping to learn which features you don't have to
implement helps optimization for performance; you don't have to
optimize what you don't write. The most powerful optimization tool in
existence may be the delete key.
One of my most productive days was throwing away 1000 lines of
code.