> The branch on the overflow flag results in a very significant loss in > performance. For example, I had to carefully write the vector `push` > method for my `Vec<T>` type to only perform one overflow check. With > two checks, it's over 5 times slower due to failed branch predictions. >
Huh, that's a bit surprising. I'd have expected branch predictor to learn really quick that the branch is never taken.
_______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev