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