Slides from Felix von Leitner's talk on C and compiler optimizations
linux-kongress.org
linux-kongress.org
long
fact(long x, long acc)
{
if (x <= 0) return acc;
return fact(x-1, acc*x);
}
(edit: the whole slide deck is summarized well on the last slide: "If you do an optimization, test it on real world data. If it’s not drastically faster but makes the code less readable: undo it.")http://www.fefe.de/know-your-compiler.pdf http://dl.fefe.de/optimizer-isec.pdf
Regardless, it's a good read!