Specialize Vec::extend to Vec::extend_from_slice#37094
Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
|
I'm not really sure what to do with the docstring on |
|
Out of curiosity, what were the conflicts with |
|
@apasel422 As far as I remember, I tried to do EDIT: |
|
@bors: r+ Thanks! |
|
📌 Commit 63ee8d0 has been approved by |
Specialize Vec::extend to Vec::extend_from_slice I tried using the existing `SpecExtend` as a helper trait for this, but the instances would always conflict with the instances higher up in the file, so I created a new helper trait. Benchmarking `extend` vs `extend_from_slice` with an slice of 1000 `u64`s gives the following results: ``` before: running 2 tests test tests::bench_extend_from_slice ... bench: 166 ns/iter (+/- 78) test tests::bench_extend_trait ... bench: 1,187 ns/iter (+/- 697) after: running 2 tests test tests::bench_extend_from_slice ... bench: 149 ns/iter (+/- 87) test tests::bench_extend_trait ... bench: 138 ns/iter (+/- 70) ```
|
💔 Test failed - auto-linux-cross-opt |
|
@bors retry |
|
⛄ The build was interrupted to prioritize another pull request. |
Specialize Vec::extend to Vec::extend_from_slice I tried using the existing `SpecExtend` as a helper trait for this, but the instances would always conflict with the instances higher up in the file, so I created a new helper trait. Benchmarking `extend` vs `extend_from_slice` with an slice of 1000 `u64`s gives the following results: ``` before: running 2 tests test tests::bench_extend_from_slice ... bench: 166 ns/iter (+/- 78) test tests::bench_extend_trait ... bench: 1,187 ns/iter (+/- 697) after: running 2 tests test tests::bench_extend_from_slice ... bench: 149 ns/iter (+/- 87) test tests::bench_extend_trait ... bench: 138 ns/iter (+/- 70) ```
These are identical since rust-lang/rust#37094 landed, and `extend_from_slice` will be deprecated in the future.
These are identical since rust-lang/rust#37094 landed, and extend_from_slice will be deprecated in the future. See also tokio-rs/website#49.
These are identical since rust-lang/rust#37094 landed, and `extend_from_slice` will be deprecated in the future.
I tried using the existing
SpecExtendas a helper trait for this, but the instances would always conflict with the instances higher up in the file, so I created a new helper trait.Benchmarking
extendvsextend_from_slicewith an slice of 1000u64s gives the following results: