Re:Beautiful branchless binary search
by rocqua on Saturday April 29, 2023 @02:55AM
(#35750685)
I believe that in release mode Rust will remove bounds checks.
[ Parent
| on HN ]
No, this is not true. Rust removes integer overflow checks in release mode, but it keeps array bounds checks.
You can see this pretty easily in compiler explorer. This is a simple array lookup compiled in release mode: