From 0ee5add908c8a657bdab2818ae33914a73fa27db Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Sat, 16 Mar 2024 00:56:41 +0200 Subject: [PATCH] Fix number of chunks to read in internal benchmark --- crates/subspace-farmer/src/single_disk_farm.rs | 12 +++++------- .../single_disk_farm/unbuffered_io_file_windows.rs | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/crates/subspace-farmer/src/single_disk_farm.rs b/crates/subspace-farmer/src/single_disk_farm.rs index 7f67c3f4a0..26b5810c5d 100644 --- a/crates/subspace-farmer/src/single_disk_farm.rs +++ b/crates/subspace-farmer/src/single_disk_farm.rs @@ -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 { diff --git a/crates/subspace-farmer/src/single_disk_farm/unbuffered_io_file_windows.rs b/crates/subspace-farmer/src/single_disk_farm/unbuffered_io_file_windows.rs index ff5886638b..549793df3a 100644 --- a/crates/subspace-farmer/src/single_disk_farm/unbuffered_io_file_windows.rs +++ b/crates/subspace-farmer/src/single_disk_farm/unbuffered_io_file_windows.rs @@ -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),