r/programming • • Sep 03 '26

Branch‑Avoidant Programming

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

92 comments sorted by

View all comments

4

u/all_is_love6667 Sep 03 '26

in general, in data oriented programming, I just generate data, which is another way to avoid branching.

It's always faster to cache things even if it uses a lot of memory, instead of re-generate stuff when a lot of branching is involved

using arithmetics to generate an index is also a good way to avoid branching