Skip to content

Commit c87148d

Browse files
committed
Update dependencies to latest versions
- Bump `rand` and `rand_distr` to versions `0.10` and `0.6`, respectively, to leverage improvements and maintain compatibility. - Update usage in benchmark support files to reflect the new API from `rand`, ensuring consistent random number generation across metrics and workload operations. - Introduce new dependencies `chacha20` and `cpufeatures` to support enhanced random number generation capabilities.
1 parent 023146c commit c87148d

5 files changed

Lines changed: 52 additions & 14 deletions

File tree

Cargo.lock

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

bench-support/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ path = "src/bin/render_docs.rs"
1111
[dependencies]
1212
cachekit = { path = "..", features = ["policy-all"] }
1313
criterion = "0.8"
14-
rand = { version = "0.9", features = ["small_rng"] }
15-
rand_distr = "0.5"
14+
rand = "0.10"
15+
rand_distr = "0.6"
1616
serde = { version = "1.0", features = ["derive"] }
1717
serde_json = "1.0"
1818
chrono = "0.4"

bench-support/src/metrics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ where
395395
let recovery_ops = capacity * 2;
396396

397397
let mut rng = rand::rngs::SmallRng::seed_from_u64(42);
398-
use rand::Rng;
398+
use rand::RngExt;
399399

400400
// Phase 1: Warmup with Zipfian
401401
let zipf = rand_distr::Zipf::new(universe as f64, 1.0).unwrap();
@@ -505,10 +505,10 @@ where
505505
let window_size = capacity / 4;
506506

507507
let mut rng = rand::rngs::SmallRng::seed_from_u64(42);
508+
use rand::RngExt;
508509

509510
// Phase 1: Warmup and stable with region A (first half of universe)
510511
let region_a_max = universe / 2;
511-
use rand::Rng;
512512

513513
for _ in 0..(warmup_ops + stable_ops) {
514514
let key = rng.random::<u64>() % region_a_max;

bench-support/src/operation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::sync::Arc;
77

88
use cachekit::traits::CoreCache;
99
use rand::rngs::SmallRng;
10-
use rand::{Rng, SeedableRng};
10+
use rand::{RngExt, SeedableRng};
1111

1212
use crate::workload::WorkloadGenerator;
1313

bench-support/src/workload.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::sync::Arc;
88

99
use cachekit::traits::CoreCache;
1010
use rand::rngs::SmallRng;
11-
use rand::{Rng, SeedableRng};
11+
use rand::{RngExt, SeedableRng};
1212
use rand_distr::{Distribution, Exp, Pareto as ParetoDistr, Zipf};
1313

1414
use crate::operation::{ReadThrough, run_operations};

0 commit comments

Comments
 (0)