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

Pretty interesting that a branchless linear search would be faster than a branching binary search! It makes sense, it just goes against the normal intuition. Just goes to show that benchmarking is always important


> it just goes against the normal intuition.

To me it's perfectly intuitive.

However, the other example he gave blew me away:

    return if cond { ... } else { ... }
The compiler evaluating both results and chosing the right one using a cmov, rather than using a branch to evaluate just one result was not what I would have expected. My how times have changed.




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

Search: