Skip to content

Commit

Permalink
Rollup merge of #77334 - pickfire:patch-4, r=jyn514
Browse files Browse the repository at this point in the history
Reorder benches const variable

Move LEN so it is is read in order.
  • Loading branch information
JohnTitor authored Oct 30, 2020
2 parents 0d33ab7 + 55ba9e4 commit 0723b27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/alloc/benches/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,8 @@ fn bench_in_place_collect_droppable(b: &mut Bencher) {
})
}

const LEN: usize = 16384;

#[bench]
fn bench_chain_collect(b: &mut Bencher) {
let data = black_box([0; LEN]);
Expand Down Expand Up @@ -613,8 +615,6 @@ pub fn map_fast(l: &[(u32, u32)]) -> Vec<u32> {
result
}

const LEN: usize = 16384;

#[bench]
fn bench_range_map_collect(b: &mut Bencher) {
b.iter(|| (0..LEN).map(|_| u32::default()).collect::<Vec<_>>());
Expand Down

0 comments on commit 0723b27

Please sign in to comment.