Performance First
While I agree with the overall feelings that the author expresses -- that people misunderstand &quot;Premature Optimization is the root of all evil&quot;[0] and in doing so treat <i>optimization</i> as something that is &quot;evil&quot; rather than <i>premature optimization</i>.  There are various misunderstandings, which lead to incorrect assumptions which lead to introducing complexity (which is likely to be counterproductive, potentially performance-<i>killing</i>) too early in the development process.  I consider the following quote to be key:<p><pre><code>     &gt; It’s never too early to start measuring and working on performance.
</code></pre>
Personally speaking, when I start feeling this way, I see it as a <i>strong signal</i> that I&#x27;m engaging in optimization too early.  I&#x27;m guided by the idea that time spent attempting to improve performance at early stages is more often wasted, or even self-defeating, than it is useful.  Knowing exactly <i>when</i> is the right time, though, is extremely tricky.<p>Most languages&#x2F;frameworks have a set of &quot;don&#x27;t do this&quot;-es that fall into the performance category -- knowing these and implementing them when the probability that they will reduce a bottleneck vs. overly-complicate code&#x2F;implementation is important.  Too often, though, the &quot;performant implementation&quot; is used because other developers are familiar with it -- not because it necessarily helps anything (i.e. using StringBuilder in C# for string concatenation -- in many common implementations, the result is <i>slower</i> but people are so used to seeing it that it becomes &quot;something many developers just do&quot; even though it is substantially uglier).<p>Performance shouldn&#x27;t be an <i>after-thought</i>.  If I&#x27;m expecting that my application <i>must</i> support 10,000 concurrent users on a single host and the work its performing couldn&#x27;t be achieved by a single-threaded server, I&#x27;m going to write the implementation thread-safe from the start.  That&#x27;s not premature optimization, that&#x27;s designing an application.  Provided the hosting constraints are not as rigid, it may make more sense to single-thread the back-end on multiple hosts.  Neither of these are as easy to reason about as a single-threaded, single-host, blocking implementation, but the alternative is &quot;it doesn&#x27;t work at all&quot; (under load, anyway).<p>The problem with measuring&#x2F;working on performance too early is that the measurements are measurements of code in isolation.  You can&#x27;t measure what isn&#x27;t written and once the various dependencies are introduced, your initial measurements&#x2F;adjustments for performance may be pointless.  Yes, you sped up the acquisition of a small blob of JSON that takes a notoriously long amount of time to produce, but because you hadn&#x27;t completed the rest of the app, you neglected the fact that another request with 250MB of JSON ran at exactly the same time.  You traded off memory for CPU to speed up the first implementation, but now you need a lot more memory for the one running in parallel and the lack of resources caused swapping, slowing <i>everything down</i> to the point that the original, slower, less-memory-consuming option for your first request was a better choice.<p>The &quot;Premature Optimization is the Root of All Evil&quot; isn&#x27;t a phrase meant to say &quot;Optimization is unimportant and you shouldn&#x27;t waste time on it&quot;.  It&#x27;s a recognition that optimization is <i>extremely important</i> and will almost certainly <i>never happen</i> due to resource exhaustion.  The confusion is about what resource is being exhausted -- the resource is <i>time</i>.  We&#x27;re all constrained by having to write functionality and make it work.  If you want to make it perform well, you&#x27;re going to burn a lot of time on optimization.  You will burn <i>far less time</i> there if you optimize your code when those optimizations are going to have the greatest benefit.  Optimizing <i>too soon</i> means you risk spending a lot of time measuring&#x2F;tweaking with a result that will not improve performance, or worse, has to be undone.  &quot;Optimized&quot; code is usually more complex&#x2F;more difficult to reason about, which makes completing the underlying feature-set more difficult.<p>Measuring and optimizing <i>at the right times</i> (and identifying the correct &quot;right times&quot;) maximizes the positive effects of the optimizations and reduce the likelihood that those optimizations will make writing the rest of the code more difficult.  Every program (and kind of program[1]) has a different &quot;right time&quot;.  Determining that &quot;right time&quot; can simply be a matter of planning your hardware &#x2F; code architecture early enough to know what is actually <i>needed</i>[2] and identifying when one should start reviewing the application for bottlenecks.<p>[0] I have much the same problem that I have with the biblical roots of that phrase and its misunderstanding.  People will often repeat &quot;Money is the root of all evil&quot; but miss the first part of that phrase &quot;... <i>the love of</i> money is the root of all evil.&quot;  With appropriate context, its meaning changes dramatically.<p>[1] Library code vs. a complete program -- My &quot;general libraries&quot; are often micro-optimized to seek the greatest performance while maintaining a balance between memory usage and CPU.  This makes them maximally useful to the vast majority of my consumers.  I might end up ripping those out of an implementation if I find a better trade-off given a complete program&#x27;s function, but most of the time it reduces the need for me to optimize around common bottlenecks<p>[2] Regular check-points &#x2F; proper planning are as close to a cure for &quot;the roots of all evil&quot; as you can get.  Performance is <i>always a feature</i> in that you know in advance what your applications constraints are and what its requirements are.  Designing code that meets neither isn&#x27;t abiding by the &quot;Premature Optimization&quot; advice; the point is avoiding writing complex implementations that eek out a few extra milliseconds of performance for a code path that is blocked by dependent-data, anyway, which is often the end result of premature optimization.