3 ms·
For those who only read the quote "premature optimization is the root of all evil", here's the context: "Programmers waste enormous amounts of time thinking ab
by marcos100 5y ago
For those who only read the quote "premature optimization is the root of all evil", here's the context:
"Programmers waste enormous amounts of time thinking about, or worrying about, the speed of noncritical parts of their programs, and these attempts at efficiency actually have a strong negative impact when debugging and maintenance are considered. We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%."
From some readings of Knuth, I have a feeling that he always think about efficient code.
- disgruntledphd2 5y agoHe definitely does. For an example, look at fascile 1 for Volume 1 of TAOCP (his new, improved assembly language for the books). https://www-cs-faculty.stanford.edu/~knuth/mmix.html https://www-cs-faculty.stanford.edu/~knuth/mmix.html He talks about measuring costs in this ASM, and he mentions that it's both cpu and mems that he measures, which is something I'd never seen before in algorithmic analysis (but which of course makes perfect sense given the large discrepancies in speed between them).