3 ms·
I suspect (but haven't verified) that modern compilers are actually implementing __builtin_expect() as a no-op. Much better alternatives exist today, e.g. GCC 8
by jart 7y ago
I suspect (but haven't verified) that modern compilers are actually implementing __builtin_expect() as a no-op. Much better alternatives exist today, e.g. GCC 8+ __cold__ and profile guided optimizations, which don't have a negative impact on code readability.