4 ms·
That last one misrepresents the complaints about premature optimization. It isn't the algorithm choice that is premature, but, say, the difference between using
by ivankirigin 19y ago
That last one misrepresents the complaints about premature optimization. It isn't the algorithm choice that is premature, but, say, the difference between using an std::string or char*.
That difference doesn't really matter unless it's part of a bottleneck of a developed system. But the O(bottleneck-function) is determined by the algorithm choice, which isn't premature to plan before starting coding.
I peeked into the ANSI Common Lisp chapter on optimization, which I think starts out by saying "optimization starts on the algorithmic level". I couldn't agree more.
- pkaler 19y agoOptimization starts at the requirements and architecture design stage. Requirements: The fastest feature is the one that you don't implement. Design: Quicksort may be faster than bubblesort. But it doesn't matter if you have layers of singletons and visitors and decorators and observers.