by returningfory2 · 4y ago · 0 comments
Suppose you have bounds checks on array accesses, but your program is 100% correct and the panic case is never hit. Doesn't the branch predictor essentially make the bounds check free? Or very low cost at least?
That said, a lot of pedestrian code that isn't running particularly hot would probably be better off including runtime checks by default.