r/programming • u/chaobang • Aug 22 '26
The unlikely Linux macro
https://rushed-reflections.bearblog.dev/an-unlikely-experiment/Wrote a bit about the `unlikely` and `likely` macros in the Linux codebase. Great little exploration into tiny optimizations that everyone should know more about 😄
186
Upvotes
View all comments
Show parent comment
1
u/OffbeatDrizzle Aug 23 '26
a normal developer should be optimising their code and / or flattening it to remove branches in the first place. I don't know why you'd sit there writing code to tell the code that's running your code which code is the likely code to execute...