3 ms·
Perhaps misguided optimisation would be a better term, and seems to be what Knuth is driving at. People do spend a lot of time worrying about all the wrong thin
by Nursie 14y ago
Perhaps misguided optimisation would be a better term, and seems to be what Knuth is driving at. People do spend a lot of time worrying about all the wrong things, many of which a decent optimising compiler will take care of.
Efficient code should always be on your mind, but actual optimisation probably ought to be done with the aid of a profiler rather than a hunch a 'clever' way of doing something.
- rahoulb 14y agoAgreed - I've seen cases where someone obsesses about shaving milliseconds off a tight loop whilst using a profiler would reveal that the real bottleneck is the code called just before entering the loop. Premature optimisation is optimisation without knowing what needs to be optimised.