-
-
Notifications
You must be signed in to change notification settings - Fork 434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove SmallRng::from_thread_rng #1532
Conversation
/// ``` | ||
/// # use rand::{SeedableRng, rngs::SmallRng}; | ||
/// let rng = SmallRng::from_os_rng(); | ||
/// let rng = SmallRng::seed_from_u64(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can keep the mention of from_os_rng
.
@@ -27,7 +27,7 @@ where | |||
{ | |||
g.throughput(criterion::Throughput::Bytes(size_of::<T>() as u64)); | |||
g.bench_function(name, |b| { | |||
let mut rng = Pcg64Mcg::from_os_rng(); | |||
let mut rng = Pcg64Mcg::from_rng(&mut rand::rng()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use of from_os_rng
should not influence the benchmark results since only time for the closure passed to iter
is measured.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. It may improve set-up time slightly; at any rate I see no harm in using rand::rng()
.
CHANGELOG.md
entrySummary
Title
Motivation
See #1531