r/programming • • Sep 03 '26

Branch‑Avoidant Programming

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

92 comments sorted by

View all comments

Show parent comment

10

u/SanityInAnarchy Sep 03 '26

I have to imagine it's also important for security-critical code that has to be hardened against timing attacks.

7

u/Ameisen Sep 03 '26

You either need to avoid branches or make sure that both branches always have the same cost (a difficult task taking into account branch prediction).