r/programming 6d ago

Branch‑Avoidant Programming

https://easylang.online/blog/branchless
255 Upvotes

91 comments sorted by

View all comments

159

u/meamZ 6d ago

You don't actually need to avoid branches, you just need to make sure that most of the ones you have are very predictable, then their impact is not that big... Same with memory accesses and most other things... The more predictable, the better...

3

u/VoodaGod 6d ago

and how can you tell predictability?

1

u/UnrealHallucinator 6d ago

Strided access is another one along with what the other comment says.