Skip to content

Commit

Permalink
Don't bench seahash and highwayhash when plotting
Browse files Browse the repository at this point in the history
  • Loading branch information
ogxd committed Nov 13, 2024
1 parent e8deec8 commit 6b9acb6
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions benches/throughput/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,27 @@ 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);
metrohash_hasher.write(data);
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
Expand Down

0 comments on commit 6b9acb6

Please sign in to comment.