3 ms·
I think Joe was commenting that many developers and tech leads tend to overestimate what optimization is premature and disregard appropriate forethought about p
by linkregister 11y ago
I think Joe was commenting that many developers and tech leads tend to overestimate what optimization is premature and disregard appropriate forethought about performance.
Saying "this bad thing is bad" is a bit of a tautology, but there is some meaning to be gleaned from the statement.
- ska 11y agoIn my experience, many developers (and tech leads) can't separate the idea of optimization from design, which is I think the core problem. But it is equally true that many of the waste inordinate amounts of time on premature or just plain misguided optimization.
- bmay 11y agoHow do you distinguish optimization from design?
- ska 11y agoYou can't optimize a system that does not exist yet. You can't effectively optimize a system you can't measure. Design activities allow you to think about how a system may and should behave. Optimization activities involve analysis of how a system actually behaves, and making changes typically involving performance trade offs, then analyzing those changes. These activities can (typically should) be iterative in nature over a complicated projects development, and they do feed into each other somewhat. What is true as a counterpoint to Knuth's maxim, is that if you do not think about the implications of your design early enough, you can easily end up painting yourself into a performance corner it may be difficult or impossible to optimize your way out of. If you've picked a fundamentally inappropriate data structure or algorithm, you may be in trouble well before you realize it. This is also why software developers would often benefit from more targeted design prototypes, earlier on. And yes, for some of this there is no easy replacement for experience. Another thing to think about: Optimization almost always costs you something, at the very least time, but often code maintainability, portability, generality etc. It is usually a trade-off (but not always). Often good design work will improve your system in many respects at once.
- cossatot 11y agoOften by abstracting the algorithmic implementation details from the system organization and logic. Then the individual algorithms can be interchanged or modified during optimization. There is of course some scale dependence to the use of these terms; the 'design' is of a larger system than the individual algorithms that compose it and can be abstracted and optimized. In cases where the scale is the same, i.e. variations of the design itself will have substantial impact on its performance characteristics, then optimization and design can't be readily distinguished and Knuth's aphorism is less clearly relevant.
- doug1001 11y ago> many developers (and tech leads) can't separate [o]ptimization from design...." brilliant--a few words that belongs somewhere more conspicuous. 'make it work' then 'make it fast' makes sense of course, but who wants to optimize code in quadratic time that could have been originally written w/ linear time complexity.