Skip to content

Commit

Permalink
chore: Add initialisation benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
Bluefinger committed Mar 26, 2024
1 parent 3c1efa2 commit 58a920b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions benches/rand_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,24 @@ fn wyhash_benchmark(c: &mut Criterion) {
},
);
});

c.bench_function("Hash new with default secret", |b| {
b.iter(|| WyHash::new_with_default_secret(black_box(42)));
});

c.bench_function("Hash new with random secret", |b| {
b.iter(|| WyHash::new(black_box(42), black_box(256)));
});

#[cfg(feature = "randomised_wyhash")]
c.bench_function("Random Hash new", |b| {
use wyrand::RandomWyHashState;
use std::hash::BuildHasher;

b.iter(|| {
RandomWyHashState::new().build_hasher()
});
});
}

pub fn benches() {
Expand Down

0 comments on commit 58a920b

Please sign in to comment.