3 ms·
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
by gwd 7y ago
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".
- mannykannot 7y agoI 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."
- cryptonector 7y agoPreallocating space you won't need is premature optimization. I think that's what TFA meant to say, and maybe even said it, who knows.