From a990de90fe41456a23e58bd087d2f107d321f3a1 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Fri, 19 Jul 2024 16:37:58 +0400 Subject: Deleted vendor folder --- vendor/rand/benches/bench.rs | 34 ------ vendor/rand/benches/distributions/exponential.rs | 18 --- vendor/rand/benches/distributions/gamma.rs | 31 ------ vendor/rand/benches/distributions/mod.rs | 3 - vendor/rand/benches/distributions/normal.rs | 18 --- vendor/rand/benches/generators.rs | 133 ----------------------- vendor/rand/benches/misc.rs | 62 ----------- 7 files changed, 299 deletions(-) delete mode 100644 vendor/rand/benches/bench.rs delete mode 100644 vendor/rand/benches/distributions/exponential.rs delete mode 100644 vendor/rand/benches/distributions/gamma.rs delete mode 100644 vendor/rand/benches/distributions/mod.rs delete mode 100644 vendor/rand/benches/distributions/normal.rs delete mode 100644 vendor/rand/benches/generators.rs delete mode 100644 vendor/rand/benches/misc.rs (limited to 'vendor/rand/benches') diff --git a/vendor/rand/benches/bench.rs b/vendor/rand/benches/bench.rs deleted file mode 100644 index d396f25..0000000 --- a/vendor/rand/benches/bench.rs +++ /dev/null @@ -1,34 +0,0 @@ -#![feature(test)] - -extern crate test; -extern crate rand; - -const RAND_BENCH_N: u64 = 1000; - -mod distributions; - -use std::mem::size_of; -use test::{black_box, Bencher}; -use rand::{StdRng, Rng}; - -#[bench] -fn rand_f32(b: &mut Bencher) { - let mut rng = StdRng::new().unwrap(); - b.iter(|| { - for _ in 0..RAND_BENCH_N { - black_box(rng.next_f32()); - } - }); - b.bytes = size_of::() as u64 * RAND_BENCH_N; -} - -#[bench] -fn rand_f64(b: &mut Bencher) { - let mut rng = StdRng::new().unwrap(); - b.iter(|| { - for _ in 0..RAND_BENCH_N { - black_box(rng.next_f64()); - } - }); - b.bytes = size_of::() as u64 * RAND_BENCH_N; -} diff --git a/vendor/rand/benches/distributions/exponential.rs b/vendor/rand/benches/distributions/exponential.rs deleted file mode 100644 index 152615d..0000000 --- a/vendor/rand/benches/distributions/exponential.rs +++ /dev/null @@ -1,18 +0,0 @@ -use std::mem::size_of; -use test::Bencher; -use rand; -use rand::distributions::exponential::Exp; -use rand::distributions::Sample; - -#[bench] -fn rand_exp(b: &mut Bencher) { - let mut rng = rand::weak_rng(); - let mut exp = Exp::new(2.71828 * 3.14159); - - b.iter(|| { - for _ in 0..::RAND_BENCH_N { - exp.sample(&mut rng); - } - }); - b.bytes = size_of::() as u64 * ::RAND_BENCH_N; -} diff --git a/vendor/rand/benches/distributions/gamma.rs b/vendor/rand/benches/distributions/gamma.rs deleted file mode 100644 index bf3fd36..0000000 --- a/vendor/rand/benches/distributions/gamma.rs +++ /dev/null @@ -1,31 +0,0 @@ -use std::mem::size_of; -use test::Bencher; -use rand; -use rand::distributions::IndependentSample; -use rand::distributions::gamma::Gamma; - -#[bench] -fn bench_gamma_large_shape(b: &mut Bencher) { - let gamma = Gamma::new(10., 1.0); - let mut rng = rand::weak_rng(); - - b.iter(|| { - for _ in 0..::RAND_BENCH_N { - gamma.ind_sample(&mut rng); - } - }); - b.bytes = size_of::() as u64 * ::RAND_BENCH_N; -} - -#[bench] -fn bench_gamma_small_shape(b: &mut Bencher) { - let gamma = Gamma::new(0.1, 1.0); - let mut rng = rand::weak_rng(); - - b.iter(|| { - for _ in 0..::RAND_BENCH_N { - gamma.ind_sample(&mut rng); - } - }); - b.bytes = size_of::() as u64 * ::RAND_BENCH_N; -} diff --git a/vendor/rand/benches/distributions/mod.rs b/vendor/rand/benches/distributions/mod.rs deleted file mode 100644 index 49f6bd9..0000000 --- a/vendor/rand/benches/distributions/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod exponential; -mod normal; -mod gamma; diff --git a/vendor/rand/benches/distributions/normal.rs b/vendor/rand/benches/distributions/normal.rs deleted file mode 100644 index 1c858b1..0000000 --- a/vendor/rand/benches/distributions/normal.rs +++ /dev/null @@ -1,18 +0,0 @@ -use std::mem::size_of; -use test::Bencher; -use rand; -use rand::distributions::Sample; -use rand::distributions::normal::Normal; - -#[bench] -fn rand_normal(b: &mut Bencher) { - let mut rng = rand::weak_rng(); - let mut normal = Normal::new(-2.71828, 3.14159); - - b.iter(|| { - for _ in 0..::RAND_BENCH_N { - normal.sample(&mut rng); - } - }); - b.bytes = size_of::() as u64 * ::RAND_BENCH_N; -} diff --git a/vendor/rand/benches/generators.rs b/vendor/rand/benches/generators.rs deleted file mode 100644 index daee7c5..0000000 --- a/vendor/rand/benches/generators.rs +++ /dev/null @@ -1,133 +0,0 @@ -#![feature(test)] - -extern crate test; -extern crate rand; - -const RAND_BENCH_N: u64 = 1000; -const BYTES_LEN: usize = 1024; - -use std::mem::size_of; -use test::{black_box, Bencher}; - -use rand::{Rng, StdRng, OsRng, JitterRng}; -use rand::{XorShiftRng, IsaacRng, Isaac64Rng, ChaChaRng}; - -macro_rules! gen_bytes { - ($fnn:ident, $gen:ident) => { - #[bench] - fn $fnn(b: &mut Bencher) { - let mut rng: $gen = OsRng::new().unwrap().gen(); - let mut buf = [0u8; BYTES_LEN]; - b.iter(|| { - for _ in 0..RAND_BENCH_N { - rng.fill_bytes(&mut buf); - black_box(buf); - } - }); - b.bytes = BYTES_LEN as u64 * RAND_BENCH_N; - } - } -} - -macro_rules! gen_bytes_new { - ($fnn:ident, $gen:ident) => { - #[bench] - fn $fnn(b: &mut Bencher) { - let mut rng = $gen::new().unwrap(); - let mut buf = [0u8; BYTES_LEN]; - b.iter(|| { - for _ in 0..RAND_BENCH_N { - rng.fill_bytes(&mut buf); - black_box(buf); - } - }); - b.bytes = BYTES_LEN as u64 * RAND_BENCH_N; - } - } -} - -gen_bytes!(gen_bytes_xorshift, XorShiftRng); -gen_bytes!(gen_bytes_isaac, IsaacRng); -gen_bytes!(gen_bytes_isaac64, Isaac64Rng); -gen_bytes!(gen_bytes_chacha, ChaChaRng); -gen_bytes_new!(gen_bytes_std, StdRng); -gen_bytes_new!(gen_bytes_os, OsRng); - - -macro_rules! gen_uint { - ($fnn:ident, $ty:ty, $gen:ident) => { - #[bench] - fn $fnn(b: &mut Bencher) { - let mut rng: $gen = OsRng::new().unwrap().gen(); - b.iter(|| { - for _ in 0..RAND_BENCH_N { - black_box(rng.gen::<$ty>()); - } - }); - b.bytes = size_of::<$ty>() as u64 * RAND_BENCH_N; - } - } -} - -macro_rules! gen_uint_new { - ($fnn:ident, $ty:ty, $gen:ident) => { - #[bench] - fn $fnn(b: &mut Bencher) { - let mut rng = $gen::new().unwrap(); - b.iter(|| { - for _ in 0..RAND_BENCH_N { - black_box(rng.gen::<$ty>()); - } - }); - b.bytes = size_of::<$ty>() as u64 * RAND_BENCH_N; - } - } -} - -gen_uint!(gen_u32_xorshift, u32, XorShiftRng); -gen_uint!(gen_u32_isaac, u32, IsaacRng); -gen_uint!(gen_u32_isaac64, u32, Isaac64Rng); -gen_uint!(gen_u32_chacha, u32, ChaChaRng); -gen_uint_new!(gen_u32_std, u32, StdRng); -gen_uint_new!(gen_u32_os, u32, OsRng); - -gen_uint!(gen_u64_xorshift, u64, XorShiftRng); -gen_uint!(gen_u64_isaac, u64, IsaacRng); -gen_uint!(gen_u64_isaac64, u64, Isaac64Rng); -gen_uint!(gen_u64_chacha, u64, ChaChaRng); -gen_uint_new!(gen_u64_std, u64, StdRng); -gen_uint_new!(gen_u64_os, u64, OsRng); - -#[bench] -fn gen_u64_jitter(b: &mut Bencher) { - let mut rng = JitterRng::new().unwrap(); - b.iter(|| { - black_box(rng.gen::()); - }); - b.bytes = size_of::() as u64; -} - -macro_rules! init_gen { - ($fnn:ident, $gen:ident) => { - #[bench] - fn $fnn(b: &mut Bencher) { - let mut rng: XorShiftRng = OsRng::new().unwrap().gen(); - b.iter(|| { - let r2: $gen = rng.gen(); - black_box(r2); - }); - } - } -} - -init_gen!(init_xorshift, XorShiftRng); -init_gen!(init_isaac, IsaacRng); -init_gen!(init_isaac64, Isaac64Rng); -init_gen!(init_chacha, ChaChaRng); - -#[bench] -fn init_jitter(b: &mut Bencher) { - b.iter(|| { - black_box(JitterRng::new().unwrap()); - }); -} diff --git a/vendor/rand/benches/misc.rs b/vendor/rand/benches/misc.rs deleted file mode 100644 index 4251761..0000000 --- a/vendor/rand/benches/misc.rs +++ /dev/null @@ -1,62 +0,0 @@ -#![feature(test)] - -extern crate test; -extern crate rand; - -use test::{black_box, Bencher}; - -use rand::{Rng, weak_rng}; -use rand::seq::*; - -#[bench] -fn misc_shuffle_100(b: &mut Bencher) { - let mut rng = weak_rng(); - let x : &mut [usize] = &mut [1; 100]; - b.iter(|| { - rng.shuffle(x); - black_box(&x); - }) -} - -#[bench] -fn misc_sample_iter_10_of_100(b: &mut Bencher) { - let mut rng = weak_rng(); - let x : &[usize] = &[1; 100]; - b.iter(|| { - black_box(sample_iter(&mut rng, x, 10).unwrap_or_else(|e| e)); - }) -} - -#[bench] -fn misc_sample_slice_10_of_100(b: &mut Bencher) { - let mut rng = weak_rng(); - let x : &[usize] = &[1; 100]; - b.iter(|| { - black_box(sample_slice(&mut rng, x, 10)); - }) -} - -#[bench] -fn misc_sample_slice_ref_10_of_100(b: &mut Bencher) { - let mut rng = weak_rng(); - let x : &[usize] = &[1; 100]; - b.iter(|| { - black_box(sample_slice_ref(&mut rng, x, 10)); - }) -} - -macro_rules! sample_indices { - ($name:ident, $amount:expr, $length:expr) => { - #[bench] - fn $name(b: &mut Bencher) { - let mut rng = weak_rng(); - b.iter(|| { - black_box(sample_indices(&mut rng, $length, $amount)); - }) - } - } -} - -sample_indices!(misc_sample_indices_10_of_1k, 10, 1000); -sample_indices!(misc_sample_indices_50_of_1k, 50, 1000); -sample_indices!(misc_sample_indices_100_of_1k, 100, 1000); -- cgit v1.2.3