Some further zlib-rs benchmarks using commit c9b7299fa81ca2a8448cbe3e96a42275c9b41b24
Rust will panic when you try to index out of bounds
This check has a cost: your CPU must perform this check. Typically this involves two instructions: a compare "is the index in bounds" and a jump "go to the panic code". Hence, we intuitively expect programs that perform bounds checking to be slightly slower. In theory, C has an edge here because it does not, by default, check that array access is in bounds.