Bubble sort slower with -O3 than -O2 with GCC
How to keep the O3 goodness without pessimizations: Use likely/unlikely liberally, unreachable(), and PGO.<p>If the code slows down, it's usually because the compiler has generated a bunch of code because it doesn't know what hot path to schedule for.<p>They will generate hundreds to thousands of instructions for factorial if you let them because it turns it into a loop, then vectorizes the loop.<p>Undefined Behaviour pub quiz question in there ^^