72
How often does branchless programming actually matter?
(programming.dev)
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Follow the wormhole through a path of communities !webdev@programming.dev
Barely never. When writing some code that really has to be high performance (i.e. where you know it slows down your program), it can help to think about if there are branches or jumps that you can potentially simplify or eliminate.
Of course some things are often branchless, for example GPU shaders, which need very high performance and which usually always do the same things. But that's an exception.
There are few people who are smarter than a compiler. And those who use "branchless coding" probably aren't.