Skip to content
Open
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
45 changes: 42 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: build lint test clean run-image build-image clean-vectors \
setup-hive test-pattern-default run-hive run-hive-debug clean-hive-logs \
load-test-fibonacci load-test-io run-hive-eels-blobs
load-test-fibonacci load-test-io run-hive-eels-blobs bench-rlp

help: ## 📚 Show help for each of the Makefile recipes
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
Expand Down Expand Up @@ -178,6 +178,9 @@ fixtures/ERC20/ERC20.bin: ## 🔨 Build the ERC20 contract for the load test
sort-genesis-files:
cd ./tooling/genesis && cargo run

bench-rlp: ## ⚡ Bench the RLP decoder/encoder
cd ./crates/common/rlp && cargo bench

# Using & so make calls this recipe only once per run
mermaid-init.js mermaid.min.js &:
@# Required for mdbook-mermaid to work
Expand Down
1 change: 1 addition & 0 deletions crates/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ secp256k1 = { workspace = true, optional = true }

[dev-dependencies]
hex-literal.workspace = true
ethrex-p2p.workspace = true

[features]
default = ["secp256k1"]
Expand Down
14 changes: 14 additions & 0 deletions crates/common/rlp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,22 @@ snap.workspace = true

[dev-dependencies]
hex-literal.workspace = true
criterion = { version = "0.7.0", features = ["html_reports"] }
ethrex-common.workspace = true
ethrex-p2p.workspace = true
ethrex-trie.workspace = true
rand.workspace = true

[lib]
path = "./rlp.rs"

[lints]
workspace = true

[[bench]]
name = "decode"
harness = false

[[bench]]
name = "encode"
harness = false
36 changes: 36 additions & 0 deletions crates/common/rlp/benches/decode.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
use criterion::{Criterion, criterion_group, criterion_main};

fn bench_decode_scalars(c: &mut Criterion) {
let mut group = c.benchmark_group("decode_scalars");
group.finish();
}

fn bench_decode_bytes_strings(c: &mut Criterion) {
let mut group = c.benchmark_group("decode_bytes_strings");
group.finish();
}

fn bench_decode_collections(c: &mut Criterion) {
let mut group = c.benchmark_group("decode_collections");
group.finish();
}

fn bench_decode_tuples(c: &mut Criterion) {
let mut group = c.benchmark_group("decode_tuples");
group.finish();
}

fn bench_decode_ips(c: &mut Criterion) {
let mut group = c.benchmark_group("decode_ip_types");
group.finish();
}

criterion_group!(
benches,
bench_decode_scalars,
bench_decode_bytes_strings,
bench_decode_collections,
bench_decode_tuples,
bench_decode_ips,
);
criterion_main!(benches);
Loading