Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Doesn’t that get mostly optimised away by the cpu branch prediction?


The branch does, but you still have the comparison itself, and also the branch instruction to decide and skip (although thanks to branch prediction, your pipeline doesn’t get flushed).

If you have enough idle execution units, you might not see a difference in wall clock time. But with many algorithms you can put those units to good use.


The branch does, but not optimizations that could be done, like vectorization.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: