Re:Show HN: Beef, a new performance-oriented programming lan...
by zozbot234 on Wednesday January 08, 2020 @06:57PM
(#21997107)
It's better to manually hoist the bound checks so that they happen before any critical loop. The compiler often can't do this because it has to preserve the partial effects of where the failed bounds check happens, but that's generally not what you really want; if anything, you'd rather fail fast.
Bound checking often is the reason rust performs worse on some benchmarks. Though I wouldn't consider this a problem at all since it can be disabled.