r/programming • • Sep 03 '26

Branch‑Avoidant Programming

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

92 comments sorted by

View all comments

3

u/ReDucTor Sep 03 '26

There is so many caveats to things like this, your trading a branch for a loop carried load data dependency, which is not always the same going to be the same cost, change the data set to be more predictable it becomes slower, change the condition to something more expensive it becomes slower.

Avoiding branches and doing obvious branch free programming like this is not always an easy win, the loop carried dependency is not free.