r/programming 1d ago

Branch‑Avoidant Programming

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

87 comments sorted by

View all comments

3

u/all_is_love6667 23h ago

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