Fix Benches (#1833)
This commit is contained in:
parent
99a70e5771
commit
7d9559b570
@ -16,7 +16,7 @@ criterion = "0.5" # Benchmarking
|
|||||||
ahash = { version = "0.8", default-features=false } # The hash function already used in hashbrown
|
ahash = { version = "0.8", default-features=false } # The hash function already used in hashbrown
|
||||||
rustc-hash = { version = "1.1", default-features=false } # yet another hash
|
rustc-hash = { version = "1.1", default-features=false } # yet another hash
|
||||||
xxhash-rust = { version = "0.8.5", features = ["xxh3"] } # xxh3 hashing for rust
|
xxhash-rust = { version = "0.8.5", features = ["xxh3"] } # xxh3 hashing for rust
|
||||||
libafl_bolts = { path = "../../libafl_bolts", default-features=false } # libafl_bolts
|
libafl_bolts = { path = "../../libafl_bolts", default-features=false, features = ["xxh3", "alloc"] } # libafl_bolts
|
||||||
|
|
||||||
[[bench]]
|
[[bench]]
|
||||||
name = "rand_speeds"
|
name = "rand_speeds"
|
||||||
|
@ -22,14 +22,15 @@ fn criterion_benchmark(c: &mut Criterion) {
|
|||||||
});*/
|
});*/
|
||||||
c.bench_function("ahash", |b| {
|
c.bench_function("ahash", |b| {
|
||||||
b.iter(|| {
|
b.iter(|| {
|
||||||
let mut hasher = ahash::RandomState::with_seeds(123, 456, 789, 123).build_hasher();
|
let mut hasher =
|
||||||
|
black_box(ahash::RandomState::with_seeds(123, 456, 789, 123).build_hasher());
|
||||||
hasher.write(black_box(&bench_vec));
|
hasher.write(black_box(&bench_vec));
|
||||||
hasher.finish();
|
hasher.finish();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
c.bench_function("fxhash", |b| {
|
c.bench_function("fxhash", |b| {
|
||||||
b.iter(|| {
|
b.iter(|| {
|
||||||
let mut hasher = rustc_hash::FxHasher::default();
|
let mut hasher = black_box(rustc_hash::FxHasher::default());
|
||||||
hasher.write(black_box(&bench_vec));
|
hasher.write(black_box(&bench_vec));
|
||||||
hasher.finish();
|
hasher.finish();
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user