3 ms·
> Seriously, it should not be hard to efficiently strip a prefix off a u8 slice in safe Rust. For example, split_first. That is a good idea for a contribution,
by scns 3y ago
> Seriously, it should not be hard to efficiently strip a prefix off a u8 slice in safe Rust. For example, split_first.
That is a good idea for a contribution, no?
- andrewaylett 3y agoYou mean like this one? https://github.com/seanmonstar/httparse/pull/86/files#diff-4bc73dd48e6ccc80311431323609ad12765c3635b53eebe2deaa4be10ecd9be6R53-R54 https://github.com/seanmonstar/httparse/pull/86/files#diff-4...
- andrewaylett 3y agoFollow up -- the benchmarks on that PR look poor, but the benchmarks don't actually quite measure what they're expected to measure -- they're not black-boxing inputs, so the compiler has an opportunity to constant-fold in some cases. I raised a PR to fix the benchmarks: https://github.com/seanmonstar/httparse/pull/151 https://github.com/seanmonstar/httparse/pull/151