Re:C++ Attribute: Likely, Unlikely
by shultays on Sunday October 22, 2023 @01:05PM
(#37977092)
Any ideas how "likely" it needs to be benefit from likely? more than 50%? or 75%? or 90%? Can it be detrimental if it has higher changes but still close to 50%?
[ Parent
| on HN ]
Yes, you could imagine a bunch of scenarios where this could hurt you. Imagine a compiler that outlines the rare branch in order to shrink the code size of the function so that the hot path has better icache performance. That function call you inserted is expensive.