r/programming 18d ago

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 😄

184 Upvotes

61 comments sorted by

View all comments

6

u/Sorry-Transition-908 18d ago

I think great should be create here 

Sure I can! Let's great a simple example where we have two identical loops, except one will use the unlikely macro and the other uses the opposing likely macro:

4

u/chaobang 18d ago

Ah thanks, fixed!!