Closed oconnor663 closed 6 years ago
This removes a dependency and slightly improves the performance of the portable implementation. But we can't land it until https://github.com/rust-lang/rust/issues/52963 is stable, unless we want to copy those unsafe
functions into the crate.
Notably, with the slight performance improvement in this PR, our b2sum
hardcoded to use portable.rs
edges past the coreutils b2sum
in performance.
Actually it turns out that the slight performance drag was entirely due to read_u64_into
, and unrolling that loop improves it, without needing to remove the byteorder
dependency. I'm going to land some of that now, and we can drop this PR. The to_le_bytes
API will be nice, but I think at least in this case it's going to compile to the same code as byteorder
.
Since that crate takes slices in its API, it tends to introduce unnecessary bounds checks.