mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 02:33:55 +00:00
2f9f2e507e
``` test vec::bench_next_chunk ... bench: 696 ns/iter (+/- 22) x86_64v1, pr test vec::bench_next_chunk ... bench: 309 ns/iter (+/- 4) znver2, default test vec::bench_next_chunk ... bench: 17,272 ns/iter (+/- 117) znver2, pr test vec::bench_next_chunk ... bench: 211 ns/iter (+/- 3) ``` The znver2 default impl seems to be slow due to inlining decisions. It goes through `core::array::iter_next_chunk` which has a deeper call tree.
29 lines
745 B
Rust
29 lines
745 B
Rust
// Disabling on android for the time being
|
|
// See https://github.com/rust-lang/rust/issues/73535#event-3477699747
|
|
#![cfg(not(target_os = "android"))]
|
|
#![feature(btree_drain_filter)]
|
|
#![feature(iter_next_chunk)]
|
|
#![feature(map_first_last)]
|
|
#![feature(repr_simd)]
|
|
#![feature(slice_partition_dedup)]
|
|
#![feature(test)]
|
|
|
|
extern crate test;
|
|
|
|
mod binary_heap;
|
|
mod btree;
|
|
mod linked_list;
|
|
mod slice;
|
|
mod str;
|
|
mod string;
|
|
mod vec;
|
|
mod vec_deque;
|
|
|
|
/// Returns a `rand::Rng` seeded with a consistent seed.
|
|
///
|
|
/// This is done to avoid introducing nondeterminism in benchmark results.
|
|
fn bench_rng() -> rand_xorshift::XorShiftRng {
|
|
const SEED: [u8; 16] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
|
|
rand::SeedableRng::from_seed(SEED)
|
|
}
|