about summary refs log tree commit diff
path: root/library/std/src/sys/unix/process/zircon.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-10-15 12:51:31 +0000
committerbors <bors@rust-lang.org>2021-10-15 12:51:31 +0000
commitaf9b508e1d6c83a8f0e6f5c0b2b75598aa37ed27 (patch)
tree2c4a3a50fe67e2710c33a76ad6fa7ae409d664a1 /library/std/src/sys/unix/process/zircon.rs
parent1dafe6d1c328d2f0580763e8438a227e490deb10 (diff)
parentcd773c358793beaae4688b4bbb60d793509f7cc0 (diff)
downloadrust-af9b508e1d6c83a8f0e6f5c0b2b75598aa37ed27.tar.gz
rust-af9b508e1d6c83a8f0e6f5c0b2b75598aa37ed27.zip
Auto merge of #88717 - tabokie:vecdeque-fast-append, r=m-ou-se
Optimize VecDeque::append

Optimize `VecDeque::append` to do unsafe copy rather than iterating through each element.

On my `Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz`, the benchmark shows 37% improvements:
```
Master:
custom-bench vec_deque_append 583164 ns/iter
custom-bench vec_deque_append 550040 ns/iter

Patched:
custom-bench vec_deque_append 349204 ns/iter
custom-bench vec_deque_append 368164 ns/iter
```

Additional notes on the context: this is the third attempt to implement a non-trivial version of `VecDeque::append`, the last two are reverted due to unsoundness or regression, see:
- https://github.com/rust-lang/rust/pull/52553, reverted in https://github.com/rust-lang/rust/pull/53571
- https://github.com/rust-lang/rust/pull/53564, reverted in https://github.com/rust-lang/rust/pull/54851

Both cases are covered by existing tests.

Signed-off-by: tabokie <xy.tao@outlook.com>
Diffstat (limited to 'library/std/src/sys/unix/process/zircon.rs')
0 files changed, 0 insertions, 0 deletions