r/SoftwareEngineering • u/fagnerbrack • Sep 07 '26
Branch‑Avoidant Programming
https://easylang.online/blog/branchless
12
Upvotes
r/SoftwareEngineering • u/fagnerbrack • Sep 07 '26
View all comments
Show parent comment
2
u/fagnerbrack Sep 08 '26
Don't use ifs cause compilers generate more CPU work, replace with boolean conditions that resolve as a formula inside value of the variable in the loop.
Doesn't matter for small data 10k, starts to matter on huge loops where micro optimisations are critical