Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions benches/workloads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
const UNIVERSE: u64 = 16_384;
const OPS: usize = 200_000;
const SEED: u64 = 42;
/// Read-through probability used by the operation model (1.0 = always read-through).
const READ_THROUGH_RATIO: f64 = 1.0;

fn make_generator(workload: Workload) -> WorkloadGenerator {
WorkloadSpec {
Expand Down Expand Up @@ -92,14 +90,20 @@
for _ in 0..iters {
let mut cache = make_cache(CAPACITY);
let mut generator = make_generator(wl);
let mut op_model = ReadThrough::new(READ_THROUGH_RATIO, SEED);

Check failure on line 93 in benches/workloads.rs

View workflow job for this annotation

GitHub Actions / Clippy

cannot find value `READ_THROUGH_RATIO` in this scope
let start = Instant::now();
let _ = run_operations(
&mut cache,
&mut generator,
OPS,
&mut op_model,
|k| Arc::clone(&value_pool[k as usize]),
|k| {
Arc::clone(
value_pool
.get(k as usize)
.expect("generator produced key outside configured UNIVERSE"),
)
},
);
total += start.elapsed();
}
Expand Down Expand Up @@ -214,7 +218,16 @@
policy_id,
&mut cache,
cfg,
|key| Arc::clone(&value_pool[key as usize]),
|key| {
let idx = key as usize;
Arc::clone(value_pool.get(idx).unwrap_or_else(|| {
panic!(
"workload key {} out of range for value_pool (len {}, expected < UNIVERSE)",
key,
value_pool.len()
)
}))
},
);
total += start.elapsed();
}
Expand Down
Loading