rust/library/core/benches/lib.rs

30 lines
648 B
Rust
Raw Normal View History

// wasm32 does not support benches (no time).
#![cfg(not(target_arch = "wasm32"))]
#![feature(flt2dec)]
2021-09-05 13:54:29 -05:00
#![feature(int_log)]
#![feature(test)]
2022-01-04 19:28:30 -06:00
#![feature(trusted_random_access)]
#![feature(iter_array_chunks)]
extern crate test;
mod any;
mod ascii;
mod char;
mod fmt;
mod hash;
mod iter;
mod num;
mod ops;
mod pattern;
mod slice;
2021-09-10 14:35:01 -05:00
mod str;
/// 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)
}