Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch out default HashMap hashers #1546

Closed
DaniPopes opened this issue Jun 18, 2024 · 2 comments
Closed

Switch out default HashMap hashers #1546

DaniPopes opened this issue Jun 18, 2024 · 2 comments

Comments

@DaniPopes
Copy link
Collaborator

DaniPopes commented Jun 18, 2024

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.

@rakita
Copy link
Member

rakita commented Jun 19, 2024

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

@rakita
Copy link
Member

rakita commented Jul 29, 2024

Closing as wontfix. ahash can be enabled with hashbrowns crate

@rakita rakita closed this as completed Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants