2020-06-18 21:45:19 +00:00
|
|
|
// wasm32 does not support benches (no time).
|
|
|
|
#![cfg(not(target_arch = "wasm32"))]
|
2024-04-05 18:45:06 +00:00
|
|
|
// Disabling in Miri as these would take too long.
|
|
|
|
#![cfg(not(miri))]
|
2017-02-03 23:04:22 +00:00
|
|
|
#![feature(flt2dec)]
|
|
|
|
#![feature(test)]
|
2022-01-05 01:28:30 +00:00
|
|
|
#![feature(trusted_random_access)]
|
2022-10-17 20:47:39 +00:00
|
|
|
#![feature(iter_array_chunks)]
|
2022-10-23 17:16:49 +00:00
|
|
|
#![feature(iter_next_chunk)]
|
2023-11-27 00:28:53 +00:00
|
|
|
#![feature(iter_advance_by)]
|
2024-08-26 05:34:25 +00:00
|
|
|
#![feature(isqrt)]
|
2017-02-03 23:04:22 +00:00
|
|
|
|
|
|
|
extern crate test;
|
|
|
|
|
|
|
|
mod any;
|
2023-02-11 03:04:36 +00:00
|
|
|
mod array;
|
2019-03-18 22:32:36 +00:00
|
|
|
mod ascii;
|
2018-11-13 17:03:06 +00:00
|
|
|
mod char;
|
2019-12-07 04:18:12 +00:00
|
|
|
mod fmt;
|
2017-02-03 23:04:22 +00:00
|
|
|
mod hash;
|
|
|
|
mod iter;
|
2024-02-22 01:54:00 +00:00
|
|
|
mod net;
|
2017-02-03 23:04:22 +00:00
|
|
|
mod num;
|
|
|
|
mod ops;
|
2019-12-16 14:33:16 +00:00
|
|
|
mod pattern;
|
2017-10-16 12:05:16 +00:00
|
|
|
mod slice;
|
2021-09-10 19:35:01 +00:00
|
|
|
mod str;
|
2023-02-17 19:46:19 +00:00
|
|
|
mod tuple;
|
2022-05-02 06:10:56 +00:00
|
|
|
|
|
|
|
/// 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)
|
|
|
|
}
|