bluealloy/revm

Switch out default HashMap hashers

DaniPopes opened this issue · 2 comments

We're currently using the standard library's default HashMap hasher which is documented to be general purpose and doesn't emphasize speed. We should switch it for more performant hashers like ahash or fxhash.

Enabling hashbrown feature:

hashbrown = ["revm-interpreter/hashbrown", "revm-precompile/hashbrown"]

cfg_if::cfg_if! {
if #[cfg(all(not(feature = "hashbrown"), feature = "std"))] {
pub use std::collections::{hash_map, hash_set, HashMap, HashSet};
use hashbrown as _;
} else {
pub use hashbrown::{hash_map, hash_set, HashMap, HashSet};
}
}

Would use hashbrown standard hashes that is ahash.
Hashbrown lib:
https://github.com/rust-lang/hashbrown/blob/4c824c548e85d75f95e0dfcee09c62c5203f9a75/Cargo.toml#L17

We can turn it on in reth

Closing as wontfix. ahash can be enabled with hashbrowns crate