Skip to content

Commit 089d993

Browse files
authored
Merge pull request #1439 from dhardy/upgrade-criterion
Upgrade criterion
2 parents d42daab + bf0301b commit 089d993

File tree

16 files changed

+112
-109
lines changed

16 files changed

+112
-109
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ jobs:
7979
run: |
8080
cargo test --target ${{ matrix.target }} --features=nightly
8181
cargo test --target ${{ matrix.target }} --all-features
82-
cargo test --target ${{ matrix.target }} --benches --features=small_rng,nightly
83-
cargo test --target ${{ matrix.target }} --manifest-path rand_distr/Cargo.toml --benches
82+
cargo test --target ${{ matrix.target }} --manifest-path benches/Cargo.toml --benches
8483
cargo test --target ${{ matrix.target }} --lib --tests --no-default-features
8584
- name: Test rand
8685
run: |
@@ -104,7 +103,7 @@ jobs:
104103
- name: Test rand_pcg
105104
run: cargo test --target ${{ matrix.target }} --manifest-path rand_pcg/Cargo.toml --features=serde1
106105
- name: Test rand_chacha
107-
run: cargo test --target ${{ matrix.target }} --manifest-path rand_chacha/Cargo.toml
106+
run: cargo test --target ${{ matrix.target }} --manifest-path rand_chacha/Cargo.toml --features=serde1
108107

109108
test-cross:
110109
runs-on: ${{ matrix.os }}

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ You may also find the [Upgrade Guide](https://rust-random.github.io/book/update.
1111
## [Unreleased]
1212
- Add `rand::distributions::WeightedIndex::{weight, weights, total_weight}` (#1420)
1313
- Bump the MSRV to 1.61.0
14+
- Move all benchmarks to new `benches` crate (#1439)
1415

1516
## [0.9.0-alpha.1] - 2024-03-18
1617
- Add the `Slice::num_choices` method to the Slice distribution (#1402)

Cargo.lock.msrv

Lines changed: 67 additions & 61 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ unbiased = []
5858

5959
[workspace]
6060
members = [
61+
"benches",
6162
"rand_core",
6263
"rand_distr",
6364
"rand_chacha",
@@ -75,25 +76,4 @@ zerocopy = { version = "=0.8.0-alpha.6", default-features = false, features = ["
7576
rand_pcg = { path = "rand_pcg", version = "=0.9.0-alpha.1" }
7677
# Only to test serde1
7778
bincode = "1.2.1"
78-
rayon = "1.5.3"
79-
criterion = { version = "0.4" }
80-
81-
[[bench]]
82-
name = "uniform"
83-
path = "benches/uniform.rs"
84-
harness = false
85-
86-
[[bench]]
87-
name = "seq_choose"
88-
path = "benches/seq_choose.rs"
89-
harness = false
90-
91-
[[bench]]
92-
name = "shuffle"
93-
path = "benches/shuffle.rs"
94-
harness = false
95-
96-
[[bench]]
97-
name = "uniform_float"
98-
path = "benches/uniform_float.rs"
99-
harness = false
79+
rayon = "1.7"

benches/Cargo.toml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
[package]
2+
name = "benches"
3+
version = "0.1.0"
4+
edition = "2021"
5+
publish = false
6+
7+
[dependencies]
8+
9+
[dev-dependencies]
10+
rand = { path = "..", features = ["small_rng", "nightly"] }
11+
rand_pcg = { path = "../rand_pcg" }
12+
rand_chacha = { path = "../rand_chacha" }
13+
rand_distr = { path = "../rand_distr" }
14+
criterion = "0.5"
15+
criterion-cycles-per-byte = "0.6"
16+
17+
[[bench]]
18+
name = "distributions"
19+
path = "src/distributions.rs"
20+
harness = false
21+
22+
[[bench]]
23+
name = "uniform"
24+
path = "src/uniform.rs"
25+
harness = false
26+
27+
[[bench]]
28+
name = "seq_choose"
29+
path = "src/seq_choose.rs"
30+
harness = false
31+
32+
[[bench]]
33+
name = "shuffle"
34+
path = "src/shuffle.rs"
35+
harness = false
36+
37+
[[bench]]
38+
name = "uniform_float"
39+
path = "src/uniform_float.rs"
40+
harness = false
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

rand_distr/benches/Cargo.toml

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)