3 ms·
Not directly. It signals that the compiler does well when optimizing the [[likely]] path at the expense of making the other paths less optimized.
by t-vi 6y ago
Not directly. It signals that the compiler does well when optimizing the [[likely]] path at the expense of making the other paths less optimized.
- secondcoming 6y agoIIUC, the optimisation is the same, but all it does is tell the compiler what the hot path is likely to be and so the code won't 'jmp' to it; the instructions are likely to be in I-cache.
- steerablesafe 6y agogcc (maybe other compilers too) can put the cold path to a separate section, so it further improves happy-path code cache locality.