Skip to content

Commit

Permalink
Merge pull request #6 from Manishearth/crate-updates
Browse files Browse the repository at this point in the history
Update benchmarking ahash dep
  • Loading branch information
flier committed Jul 28, 2023
2 parents 163460a + 629238b commit 45484ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ xxhash2 = "0.1"
twox-hash = "1.1"
seahash = "3.0"
fxhash = "0.2"
ahash = "0.1"
ahash = "0.8"
rustc-hash = "1.0"
meowhash = "0.1"

Expand Down
7 changes: 3 additions & 4 deletions benches/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ extern crate lazy_static;
extern crate criterion;

use std::collections::hash_map::DefaultHasher;
use std::hash::{Hasher, BuildHasher};
use std::hash::Hasher;
use std::hash::SipHasher;
use std::io::BufReader;
use std::mem;
use std::slice;

use criterion::{black_box, Criterion, ParameterizedBenchmark, Throughput};

use ahash::ABuildHasher;
use ahash::AHasher;
use farmhash::{hash32_with_seed as farmhash32, hash64_with_seed as farmhash64};
use fnv::FnvHasher;
use fxhash::{hash32 as fxhash32, hash64 as fxhash64};
Expand Down Expand Up @@ -192,9 +192,8 @@ fn bench_hash64(c: &mut Criterion) {
b.iter(|| fxhash64(&DATA[..size]));
})
.with_function("ahash", move |b, &&size| {
let builder = ABuildHasher::new();
b.iter(|| {
let mut h = builder.build_hasher();
let mut h = AHasher::default();
h.write(&DATA[..size]);
h.finish()
});
Expand Down

0 comments on commit 45484ad

Please sign in to comment.