asm-keccak added (#5997)

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
This commit is contained in:
Shashank Trivedi
2024-01-13 04:41:29 +05:30
committed by GitHub
parent e67567cf01
commit 8761072977
4 changed files with 18 additions and 6 deletions

View File

@ -231,4 +231,4 @@ update-book-cli: ## Update book cli documentation.
.PHONY: maxperf
maxperf:
RUSTFLAGS="-C target-cpu=native" cargo build --profile maxperf --features jemalloc
RUSTFLAGS="-C target-cpu=native" cargo build --profile maxperf --features jemalloc,asm-keccak

View File

@ -125,13 +125,18 @@ procfs = { version = "0.16.0" }
[features]
default = ["jemalloc"]
asm-keccak = ["reth-primitives/asm-keccak"]
jemalloc = ["dep:jemallocator", "dep:jemalloc-ctl"]
jemalloc-prof = ["jemalloc", "jemallocator?/profiling"]
min-error-logs = ["tracing/release_max_level_error"]
min-warn-logs = ["tracing/release_max_level_warn"]
min-info-logs = ["tracing/release_max_level_info"]
min-debug-logs = ["tracing/release_max_level_debug"]
min-trace-logs = ["tracing/release_max_level_trace"]
optimism = [
"reth-primitives/optimism",
"reth-revm/optimism",
@ -149,6 +154,7 @@ optimism = [
"reth-optimism-payload-builder/optimism",
"reth-ethereum-payload-builder/optimism",
]
# no-op feature flag for switching between the `optimism` and default functionality in CI matrices
ethereum = []

View File

@ -102,13 +102,18 @@ RUSTFLAGS="-C target-cpu=native" cargo build --profile maxperf
**Features**
Finally, some features may improve performance on your system, most notably `jemalloc`, which replaces the default memory allocator used by reth.
Finally, some optional features are present that may improve performance, but may not very portable,
and as such might not compile on your particular system. These are currently:
- `jemalloc`: replaces the default system memory allocator with [`jemalloc`](https://jemalloc.net/); this feature is unstable on Windows
- `asm-keccak`: replaces the default, pure-Rust implementation of Keccak256 with one implemented in assembly; see [the `keccak-asm` crate](https://github.com/DaniPopes/keccak-asm) for more details and supported targets
- `min-LEVEL-logs`, where `LEVEL` is one of `error`, `warn`, `info`, `debug`, `trace`: disables compilation of logs of lower level than the given one; this in general isn't that significant, and is not recommended due to the loss of debugging that the logs would provide
You can enable features by passing them to the `--features` Cargo flag.
You can activate features by passing them to the `--features` or `-F` Cargo flag;
multiple features can be activated with a space- or comma-separated list to the flag:
> **Note**
>
> The `jemalloc` feature is unstable on Windows due to jemallocator itself.
```bash
RUSTFLAGS="-C target-cpu=native" cargo build --profile maxperf --features jemalloc,asm-keccak
```
## Troubleshooting

View File

@ -91,6 +91,7 @@ secp256k1.workspace = true
[features]
default = ["c-kzg"]
asm-keccak = ["alloy-primitives/asm-keccak"]
arbitrary = [
"revm-primitives/arbitrary",
"reth-rpc-types/arbitrary",