3 ms·
You're right, but it's worth reading the rest of the paragraph: "We should forget about small efficiencies, say about 97% of the time: premature optimization i
by PaulRobinson 7y ago
You're right, but it's worth reading the rest of the paragraph:
"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%." -- Knuth
Knuth was trying to say you shouldn't guess. If you think you will get a performance gain, but you're not sure where or how the performance is going to suffer, hold back. But if you know you're doing something that is normally bad and you can fix it, it's OK to get on with it.
Your final paragraph makes me think we're both on the same wavelength here, but I think it's worth remembering that Knuth was not saying "never optimize until you have to"