3 ms·
I did once have a bizarre situation where removing a bounds check that always succeeded degraded performance by over 30%. The bounds check wasn't being elided
by Measter 5y ago
I did once have a bizarre situation where removing a bounds check that always succeeded degraded performance by over 30%.
The bounds check wasn't being elided either. I checked and it was there in the assembly, so I figured that the function is so hot that an unchecked access might help things. Apparently not. The only thing I can think of is that the reduction in code-size for that function had an unintended effect elsewhere, either for the optimizer or that it resulted in a hot bit of code crossing a cache line?
- rini17 5y agoOr the always succeeding check helped CPU's branch predictor substantially.