3 ms·
The most important part for me was chapter 1: "the best optimizer is between your ears". Before you go unrolling loops and doing bit shifts to shave time at the
by mysterydip 7y ago
The most important part for me was chapter 1: "the best optimizer is between your ears". Before you go unrolling loops and doing bit shifts to shave time at the micro scale, see if there's a different way to do what you want at the macro scale. Different algorithm, data structure, etc.
- raverbashing 7y agoI'd add one small thing (from the book): There Ain't No Such Thing as The Fastest Code (A good sum up https://blog.codinghorror.com/there-aint-no-such-thing-as-the-fastest-code/ https://blog.codinghorror.com/there-aint-no-such-thing-as-th... ) There are multiple ways of optimizing a code with different caveats and advantages
- Ono-Sendai 7y agoSometimes there is such a thing as the fastest code: http://forwardscattering.org/post/13 http://forwardscattering.org/post/13 Edit: In the black book the 'ain't no such thing as the fastest code' seemed to be a bit of 'folksy' wisdom, illustrated by various anecdotes about fast code being upstaged by yet faster code. However it rubs me a little the wrong way, considering that it's not actually a true statement as demonstrated in my link above.
- remon 7y agoYou're right of course but I think we have to recognise that for all sufficiently complex problems Abrash' "folksy wisdom" is effectively true and, in his particular case, a good chapter title more than a statement of fact.
- vardump 7y agoTrue on an ideal computer with absolutely no other software running and no cache effects, dependency chain stalls, branch prediction failures, and so on. Software equivalent of a spherical cow.
- inflatableDodo 7y agoHardware matters.