Skip to content

Commit f6ec1e1

Browse files
authored
Update read-path layer benchmarks to consistently report throughput in Gib/s (#1397)
This updates the `prefetch_benchmark` and `download_crt` to report throughput consistently with the `client_benchmark`. Note, the upload path is untouched - notably, uploader benchmarks format is quite different from these in reporting and still uses MiB/s. ### Does this change impact existing behavior? This updates the output of the read-path benchmarks to be consistently formatted. There's no way to switch back to the old format. ### Does this change need a changelog entry? Does it require a version change? No, benchmark change only. --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the [Developer Certificate of Origin (DCO)](https://developercertificate.org/). Signed-off-by: Daniel Carl Jones <djonesoa@amazon.com>
1 parent c6bc7db commit f6ec1e1

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

mountpoint-s3-crt/examples/download_crt.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,14 @@ fn main() -> anyhow::Result<()> {
249249
Ok::<_, anyhow::Error>(bytes_received.load(Ordering::SeqCst))
250250
})?;
251251
let elapsed = start.elapsed();
252+
let throughput_bytes = num_bytes as f64 / elapsed.as_secs_f64();
253+
let throughput_gibibits = throughput_bytes / (1024.0 * 1024.0 * 1024.0 / 8.0);
252254
println!(
253-
"iteration {}: {}b in {}s = {:.2}MiB/s",
255+
"{}: received {} bytes in {:.2}s: {:.2} Gib/s",
254256
i,
255257
num_bytes,
256258
elapsed.as_secs_f64(),
257-
num_bytes as f64 / elapsed.as_secs_f64() / (1024.0 * 1024.0)
259+
throughput_gibibits,
258260
);
259261
}
260262

mountpoint-s3-fs/examples/prefetch_benchmark.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,11 @@ fn main() {
174174

175175
let received_size = received_bytes.load(Ordering::SeqCst);
176176
println!(
177-
"{}: received {} bytes in {:.2}s: {:.2}MiB/s",
177+
"{}: received {} bytes in {:.2}s: {:.2} Gib/s",
178178
i,
179179
received_size,
180180
elapsed.as_secs_f64(),
181-
(received_size as f64) / elapsed.as_secs_f64() / (1024 * 1024) as f64
181+
(received_size as f64) / elapsed.as_secs_f64() / (1024 * 1024 * 1024 / 8) as f64
182182
);
183183
}
184184
}

0 commit comments

Comments
 (0)