-
Notifications
You must be signed in to change notification settings - Fork 399
Closed
Description
Using this example:
use rand::Rng;
#[cfg(test)]
mod tests {
use std::hint::black_box;
use rand::Rng;
fn generate_random(n: usize) {
let mut rng = rand::rng();
for i in 0..n {
black_box(rng.random_bool(0.5));
}
}
#[test] fn gen_10() { generate_random(10); }
#[test] fn gen_100() { generate_random(100); }
#[test] fn gen_1000() { generate_random(1000); }
#[test] fn gen_10000() { generate_random(10_000); }
#[test] fn gen_100000() { generate_random(100_000); }
}to generate an increasing number of random bools takes much longer with Miri than without.
Running without Miri completes in less than a second, with Miri, even just 10000 takes multiple seconds, generating 100,000 does not seem to finish in 30 seconds.
Is there a way of speeding up random value generation?
I tried MIRIFLAGS="-Zmiri-disable-isolation" cargo +nightly miri test but it did not speed up the process.
Metadata
Metadata
Assignees
Labels
No labels