r/programming 1d ago

Branch‑Avoidant Programming

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

87 comments sorted by

View all comments

27

u/bodiam 1d ago

That's interesting. Would this also apply to higher languages, like Java, which run on a JVM? (Not intending to rewrite my code, but I'm curious how much languages like Java benefit from branch prediction and brancheless approaches)

2

u/iris700 1d ago

If it ends up getting compiled to native code it probably would, if not I'm not sure but it's probably not running frequently enough to matter (assuming HotSpot)