]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #96626 - thomcc:rand-bump, r=m-ou-se
authorbors <bors@rust-lang.org>
Thu, 5 May 2022 05:08:44 +0000 (05:08 +0000)
committerbors <bors@rust-lang.org>
Thu, 5 May 2022 05:08:44 +0000 (05:08 +0000)
Avoid using `rand::thread_rng` in the stdlib benchmarks.

This is kind of an anti-pattern because it introduces extra nondeterminism for no real reason. In thread_rng's case this comes both from the random seed and also from the reseeding operations it does, which occasionally does syscalls (which adds additional nondeterminism). The impact of this would be pretty small in most cases, but it's a good practice to avoid (particularly because avoiding it was not hard).

Anyway, several of our benchmarks already did the right thing here anyway, so the change was pretty easy and mostly just applying it more universally. That said, the stdlib benchmarks aren't particularly stable (nor is our benchmark framework particularly great), so arguably this doesn't matter that much in practice.

~~Anyway, this also bumps the `rand` dev-dependency to 0.8, since it had fallen somewhat out of date.~~ Nevermind, too much of a headache.

1  2 
Cargo.lock
library/core/benches/lib.rs

diff --cc Cargo.lock
Simple merge
Simple merge