But this isn't at all an example of "premature optimization". There was a well-defined, long-term issue they were having, and someone fired up a profiler, and showed that a particular change had a massive impact. That's exactly the opposite of "premature optimization".
Re:A single character code change
by mannykannot on Thursday January 02, 2020 @03:52PM
(#21939681)
I think it is supposed to be an example of just-in-time optimization that almost did not happen. The implication seems to be that the architects did not even consider code-level optimization as a possible solution.
Maybe the better message is "try to understand the causes of your problem before you try to solve it."
Re:A single character code change
by cryptonector on Thursday January 02, 2020 @11:17PM
(#21943106)
Preallocating space you won't need is premature optimization. I think that's what TFA meant to say, and maybe even said it, who knows.
Re:A single character code change
by theonemind on Thursday January 02, 2020 @01:35PM
(#21938204)
In general, I’ve found some of the worst thinking in otherwise smart people from ideological thinking. My self-destructing rule of thumb is “don’t be an ideologue”.
Not all optimization is premature!
Re:A single character code change
by mannykannot on Thursday January 02, 2020 @01:37PM
(#21938225)
Precisely -- dogmatism fails because it does not deal with situations that call for sometimes subtle, case-by-case judgement.
Re:A single character code change
by bryanrasmussen on Friday January 03, 2020 @04:15AM
(#21944425)
the original premature optimization text posited scenarios where complicated algorithmic patterns were implemented (that took a significant amount of development time) before it was found out whether they were needed or not.
I think this is more
Obvious and simple optimizations are beneficial.
I feel in the case of this optimization it also improves the code by making it more clear what is wanted.
I think that is likely often the case with simple optimizations.
It seems plausible to me that halting the re-architecting project would produce the savings claimed.