mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-05 11:33:04 +00:00
exercise more of the in-place pipeline in the bench
This commit is contained in:
parent
a9c78e371e
commit
a596ff36b5
@ -513,7 +513,14 @@ impl Drop for Droppable {
|
|||||||
#[bench]
|
#[bench]
|
||||||
fn bench_in_place_collect_droppable(b: &mut test::Bencher) {
|
fn bench_in_place_collect_droppable(b: &mut test::Bencher) {
|
||||||
let v: Vec<Droppable> = std::iter::repeat_with(|| Droppable(0)).take(1000).collect();
|
let v: Vec<Droppable> = std::iter::repeat_with(|| Droppable(0)).take(1000).collect();
|
||||||
b.iter(|| v.clone().into_iter().skip(100).collect::<Vec<_>>())
|
b.iter(|| {
|
||||||
|
v.clone()
|
||||||
|
.into_iter()
|
||||||
|
.skip(100)
|
||||||
|
.enumerate()
|
||||||
|
.map(|(i, e)| Droppable(i ^ e.0))
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[bench]
|
#[bench]
|
||||||
|
Loading…
Reference in New Issue
Block a user