From 74d7a21e8d39ed41f9ae9332e1b53d62081917c1 Mon Sep 17 00:00:00 2001 From: Olivier Giniaux Date: Wed, 13 Nov 2024 22:20:26 +0100 Subject: [PATCH] Don't bench seahash and highwayhash when plotting --- benches/throughput/main.rs | 25 ++++++++++++++----------- benches/throughput/result_processor.rs | 4 +++- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/benches/throughput/main.rs b/benches/throughput/main.rs index 7cfdb48..bc3a3fb 100644 --- a/benches/throughput/main.rs +++ b/benches/throughput/main.rs @@ -66,17 +66,6 @@ fn main() { fnv_hasher.finish() }); - // HighwayHash - benchmark(processor.as_mut(), slice, "HighwayHash", |data: &[u8], _: i32| -> u64 { - use highway::{HighwayHasher, HighwayHash}; - HighwayHasher::default().hash64(data) - }); - - // SeaHash - benchmark(processor.as_mut(), slice, "SeaHash", |data: &[u8], seed: u64| -> u64 { - seahash::hash_seeded(data, seed, 0, 0, 0) - }); - // MetroHash benchmark(processor.as_mut(), slice, "Metrohash", |data: &[u8], seed: i32| -> u64 { let mut metrohash_hasher = metrohash::MetroHash64::with_seed(seed as u64); @@ -84,6 +73,20 @@ fn main() { metrohash_hasher.finish() }); + // Don't benchmark theses when plotting because they're too slow resulting in the Y-axis too zoomed-out + if cfg!(not(feature = "bench-plot")) { + // HighwayHash + benchmark(processor.as_mut(), slice, "HighwayHash", |data: &[u8], _: i32| -> u64 { + use highway::{HighwayHasher, HighwayHash}; + HighwayHasher::default().hash64(data) + }); + + // SeaHash + benchmark(processor.as_mut(), slice, "SeaHash", |data: &[u8], seed: u64| -> u64 { + seahash::hash_seeded(data, seed, 0, 0, 0) + }); + } + processor.finish(); // Free benchmark data diff --git a/benches/throughput/result_processor.rs b/benches/throughput/result_processor.rs index 8963cbe..63e0c60 100644 --- a/benches/throughput/result_processor.rs +++ b/benches/throughput/result_processor.rs @@ -150,7 +150,9 @@ impl ResultProcessor for OutputPlot { chart .configure_mesh() - .max_light_lines(1) + .x_max_light_lines(1) + .y_max_light_lines(2) + .y_labels(10) .x_desc("Input Size (bytes)") .y_desc("Throughput (MiB/s)") .draw().unwrap();