Skip to content

Commit

Permalink
Fix number of chunks to read in internal benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc committed Mar 16, 2024
1 parent d495496 commit 0ee5add
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
12 changes: 5 additions & 7 deletions crates/subspace-farmer/src/single_disk_farm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2207,13 +2207,11 @@ where
// A lot simplified version of concurrent chunks
{
let start = Instant::now();
(0..Record::NUM_S_BUCKETS)
.into_par_iter()
.try_for_each(|_| {
let offset = thread_rng().gen_range(0_usize..sector_size / Scalar::FULL_BYTES)
* Scalar::FULL_BYTES;
farming_plot.read_at(&mut [0; Scalar::FULL_BYTES], offset as u64)
})?;
(0..Record::NUM_CHUNKS).into_par_iter().try_for_each(|_| {
let offset = thread_rng().gen_range(0_usize..sector_size / Scalar::FULL_BYTES)
* Scalar::FULL_BYTES;
farming_plot.read_at(&mut [0; Scalar::FULL_BYTES], offset as u64)
})?;
let elapsed = start.elapsed();

if elapsed >= INTERNAL_BENCHMARK_READ_TIMEOUT {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ mod tests {
(5, MAX_READ_SIZE * 2 - 5),
(5, MAX_READ_SIZE),
(5, MAX_READ_SIZE * 2),
(MAX_READ_SIZE + 0, MAX_READ_SIZE),
(MAX_READ_SIZE + 0, MAX_READ_SIZE * 2),
(MAX_READ_SIZE, MAX_READ_SIZE),
(MAX_READ_SIZE, MAX_READ_SIZE * 2),
(MAX_READ_SIZE + 5, MAX_READ_SIZE - 5),
(MAX_READ_SIZE + 5, MAX_READ_SIZE * 2 - 5),
(MAX_READ_SIZE + 5, MAX_READ_SIZE),
Expand Down

0 comments on commit 0ee5add

Please sign in to comment.