Skip to content

Commit

Permalink
add xxhash-rust for xxh3
Browse files Browse the repository at this point in the history
  • Loading branch information
flier committed Feb 19, 2024
1 parent 1754480 commit 9c51386
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ seahash = "4.1"
twox-hash = "1.6"
wyhash = "0.5"
xxhash2 = "0.1"
xxhash-rust = { version = "0.8", features = ["xxh3"] }

[build-dependencies]
rustc_version = "0.4"
Expand Down
4 changes: 4 additions & 0 deletions benches/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ use t1ha::{t1ha0_32, t1ha1, t1ha2_atonce, t1ha2_atonce128};
use twox_hash::{XxHash as XxHash64, XxHash32};
use wyhash::wyhash;
use xxhash2::{hash32 as xxhash32, hash64 as xxhash64};
use xxhash_rust::xxh3::xxh3_64_with_seed;

cfg_if! {
if #[cfg(target_feature = "aes")] {
Expand Down Expand Up @@ -218,6 +219,9 @@ fn bench_hash64(c: &mut Criterion) {
});
},
)
.bench_with_input(BenchmarkId::new("xxh3_64", size), &size, |b, _| {
b.iter(|| xxh3_64_with_seed(data, SEED));
})
.bench_with_input(BenchmarkId::new("seahash", size), &size, |b, _| {
b.iter(|| seahash64(data, SEED, SEED, SEED, SEED));
})
Expand Down

0 comments on commit 9c51386

Please sign in to comment.