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

[feat]: speedy hash map #3

Merged
merged 2 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/interpreter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ serde = ["dep:serde", "revm-primitives/serde"]
arbitrary = ["std", "revm-primitives/arbitrary"]
asm-keccak = ["revm-primitives/asm-keccak"]
portable = ["revm-primitives/portable"]
faster-hash = ["revm-primitives/faster-hash"]

optimism = ["revm-primitives/optimism"]
# Optimism default handler enabled Optimism handler register by default in EvmBuilder.
Expand Down
3 changes: 3 additions & 0 deletions crates/precompile/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,15 @@ portable = ["revm-primitives/portable", "c-kzg?/portable"]
# In Linux it passes. If you don't require to build wasm on win/mac, it is safe to use it and it is enabled by default.
secp256k1 = ["dep:secp256k1"]

faster-hash = ["revm-primitives/faster-hash"]

all = [
"std",
"asm-keccak",
"c-kzg",
"portable",
"secp256k1",
"faster-hash"
]

[[bench]]
Expand Down
1 change: 1 addition & 0 deletions crates/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ serde = [
arbitrary = ["std", "alloy-primitives/arbitrary", "bitflags/arbitrary"]
asm-keccak = ["alloy-primitives/asm-keccak"]
portable = ["c-kzg?/portable"]
faster-hash = ["hashbrown/ahash"]

optimism = []
# Optimism default handler enabled Optimism handler register by default in EvmBuilder.
Expand Down
4 changes: 3 additions & 1 deletion crates/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ pub use constants::*;
pub use env::*;

cfg_if::cfg_if! {
if #[cfg(feature = "std")] {
if #[cfg(feature = "faster-hash")] {
pub use hashbrown::{hash_map, hash_set, HashMap, HashSet};
} else if #[cfg(feature = "std")] {
pub use std::collections::{hash_map, hash_set, HashMap, HashSet};
use hashbrown as _;
} else {
Expand Down
1 change: 1 addition & 0 deletions crates/revm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ serde-json = ["serde", "dep:serde_json"]
arbitrary = ["revm-interpreter/arbitrary"]
asm-keccak = ["revm-interpreter/asm-keccak", "revm-precompile/asm-keccak"]
portable = ["revm-precompile/portable", "revm-interpreter/portable"]
faster-hash = ["revm-interpreter/faster-hash", "revm-precompile/faster-hash"]

test-utils = []

Expand Down