Comment by Someone

2 days ago

> I suspect a sufficiently advanced compiler can remove bounds checks where they are provably unnecessary,

That’s true by definition, isn’t it?

> and a sufficiently advanced CPU can run the remaining checks in parallel with the array accesses.

But it still would slow down the program, as the CPU would have to commit resources to that bound checking that it then cannot use for doing other things.