Skip to content

Conversation

@dhardy
Copy link
Member

@dhardy dhardy commented Nov 20, 2024

  • Added a CHANGELOG.md entry

Summary

Title

Motivation

See #1531

@dhardy dhardy requested review from newpavlov and vks November 20, 2024 11:50
/// ```
/// # use rand::{SeedableRng, rngs::SmallRng};
/// let rng = SmallRng::from_os_rng();
/// let rng = SmallRng::seed_from_u64(1);
Copy link
Member

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.

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());
Copy link
Member

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.

Copy link
Member Author

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().

@dhardy dhardy merged commit c68463c into rust-random:master Nov 22, 2024
16 checks passed
benjamin-lieser pushed a commit to benjamin-lieser/rand that referenced this pull request Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants