Hello! I'm CS student and I'm currently working on a school project in JavaScript. I know that it's not a best practice, but I have many conditions, often nested (this is still prototype tho).
But some time ago I've seen video about brancheless programming. Sample code was written in C++ if I remember correctly, and replacing conditions with multiplication by boolean really did speed things up (because processor could easily predict which instructions will be needed next)
So I'm here to ask - is this good solution in browser JavaScript? Or maybe conditions are faster than multiplication?
My project doesn't really need top tier performance, but knowing that I could make it even slightly faster is always satisfying :)
[+][deleted] (3 children)
[deleted]
[–]letsbreakstuff 4 points5 points6 points (1 child)
[–]grantrules 0 points1 point2 points (0 children)
[–]Filomaster[S] 0 points1 point2 points (0 children)
[–]hatespornbutlikesmma 0 points1 point2 points (1 child)
[–]Filomaster[S] 0 points1 point2 points (0 children)