Skip to content

Commit

Permalink
Use faster RNG
Browse files Browse the repository at this point in the history
(cherry picked from commit 750395d)
  • Loading branch information
pkolaczk authored and vponomaryov committed Oct 29, 2024
1 parent 4269557 commit 1c144e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ openssl = "0.10.38"
parse_duration = "2.1.1"
pin-project = "1.1"
plotters = { version = "0.3", default-features = false, features = ["line_series", "svg_backend", "full_palette"]}
rand = "0.8"
rand = { version = "0.8", default-features = false, features = ["small_rng", "std"] }
regex = "1.5"
rune = "0.13"
rust-embed = "8"
Expand Down
4 changes: 2 additions & 2 deletions src/workload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::time::Instant;

use hdrhistogram::Histogram;
use rand::distributions::{Distribution, WeightedIndex};
use rand::rngs::StdRng;
use rand::rngs::SmallRng;
use rand::{Rng, SeedableRng};
use rune::alloc::clone::TryClone;
use rune::compile::meta::Kind;
Expand Down Expand Up @@ -482,7 +482,7 @@ impl Workload {
/// Returns the cycle number and the end time of the query.
pub async fn run(&self, cycle: i64) -> Result<(i64, Instant), LatteError> {
let start_time = Instant::now();
let mut rng = StdRng::seed_from_u64(cycle as u64);
let mut rng = SmallRng::seed_from_u64(cycle as u64);
let context = SessionRef::new(&self.context);
let result = self
.program
Expand Down

0 comments on commit 1c144e1

Please sign in to comment.