rust/library/alloc/src
bors a090c8659c Auto merge of #91527 - the8472:retain-opt, r=dtolnay
Optimize `vec::retain` performance

This simply moves the loops into the inner function which leads to better results.

```
old:

test vec::bench_retain_100000                            ... bench:     203,828 ns/iter (+/- 2,101)
test vec::bench_retain_iter_100000                       ... bench:      63,324 ns/iter (+/- 12,305)
test vec::bench_retain_whole_100000                      ... bench:      42,989 ns/iter (+/- 291)

new:

test vec::bench_retain_100000                            ... bench:      42,180 ns/iter (+/- 451)
test vec::bench_retain_iter_100000                       ... bench:      65,167 ns/iter (+/- 11,971)
test vec::bench_retain_whole_100000                      ... bench:      33,736 ns/iter (+/- 12,404)
```

Measured on x86_64-unknown-linux-gnu, Zen2

Fixes #91497
2021-12-16 07:58:36 +00:00
..
alloc Rename AllocRef to Allocator and (de)alloc to (de)allocate 2020-12-04 14:47:15 +01:00
collections Rollup merge of #91529 - TennyZhuang:try_reserve_binary_heap, r=yaahc 2021-12-14 10:21:02 +01:00
raw_vec Add a unit test for zero-sized types in RawVec. 2021-11-26 19:30:45 +11:00
rc Re-stabilize Weak::as_ptr &friends for unsized T 2021-01-06 19:30:22 -05:00
sync Rollup merge of #80764 - CAD97:weak-unsized-as-ptr-again, r=RalfJung 2021-01-16 17:29:56 +00:00
vec Auto merge of #91527 - the8472:retain-opt, r=dtolnay 2021-12-16 07:58:36 +00:00
alloc.rs Add #[must_use] to alloc functions that would leak memory 2021-10-30 22:19:07 -04:00
borrow.rs Const Deref 2021-09-15 03:06:53 +00:00
boxed.rs Rollup merge of #90851 - ibraheemdev:downcast-unchecked, r=scottmcm 2021-12-04 02:26:21 +01:00
fmt.rs Give examples of format args capture in the fmt module documentation 2021-11-15 10:13:44 +01:00
lib.rs Rollup merge of #90521 - jhpratt:stabilize-destructuring_assignment, r=jackh726,pnkfelix 2021-12-15 08:36:19 +01:00
macros.rs Remove alloc/malloc/calloc/realloc doc aliases 2021-06-30 19:59:39 +01:00
raw_vec.rs Introduce RawVec::reserve_for_push. 2021-11-30 08:10:47 +11:00
rc.rs doc: fix typo in comments 2021-12-12 00:27:27 +01:00
slice.rs Re-export core::slice::EscapeAscii 2021-11-05 17:14:57 +10:00
str.rs Use spare_capacity_mut instead of invalid unchecked indexing 2021-12-08 17:58:57 -05:00
string.rs doc: suggest try_reserve in try_reserve_exact 2021-12-05 14:38:59 +08:00
sync.rs doc: fix typo in comments 2021-12-12 00:27:27 +01:00
task.rs Document From implementations for Waker and RawWaker 2021-04-22 14:16:33 -07:00
tests.rs Fix alloc::test::test_show 2021-04-21 15:45:41 +02:00