4 ms·
> Is there any evidence this is a tradeoff? Bound checking often is the reason rust performs worse on some benchmarks. Though I wouldn't consider this a proble
by NilsIRL 7y ago
> Is there any evidence this is a tradeoff?
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.
- zozbot234 7y agoIt'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.