Skip to content

perf(core): reuse buffer in trie commits (WIP) #3511

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

SDartayet
Copy link
Contributor

Motivation

Improving performance when adding new trie nodes.

Description

This PR introduces a vector used as a buffer for the RLP encode. Said vector is then drained when the contents are pushed into the accumulator for the RLP encodings of the node's children

Closes #3267

Copy link

github-actions bot commented Jul 7, 2025

Lines of code report

Total lines added: 18
Total lines removed: 0
Total lines changed: 18

Detailed view
+-----------------------------------+-------+------+
| File                              | Lines | Diff |
+-----------------------------------+-------+------+
| ethrex/crates/common/trie/node.rs | 251   | +8   |
+-----------------------------------+-------+------+
| ethrex/crates/common/trie/trie.rs | 914   | +10  |
+-----------------------------------+-------+------+

Copy link

github-actions bot commented Jul 7, 2025

Benchmark for 494db23

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 35.5±0.88ms 35.1±0.34ms -1.13%
Trie/cita-trie insert 1k 3.7±0.04ms 3.7±0.10ms 0.00%
Trie/ethrex-trie insert 10k 55.8±0.36ms 55.0±0.57ms -1.43%
Trie/ethrex-trie insert 1k 6.5±0.05ms 6.4±0.06ms -1.54%

Copy link

github-actions bot commented Jul 7, 2025

Benchmark for 494db23

Click to view benchmark
Test Base PR %
block payload building bench 0.2±0.00ns 0.2±0.00ns 0.00%

@ilitteri ilitteri moved this to In Progress in ethrex_l2 Jul 7, 2025
Copy link

github-actions bot commented Jul 7, 2025

Benchmark Block Execution Results Comparison Against Main

Command Mean [s] Min [s] Max [s] Relative
base 212.277 ± 1.784 209.830 214.979 1.01 ± 0.01
head 210.093 ± 1.031 208.758 211.845 1.00

Copy link

Benchmark for 999fd67

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 35.9±1.63ms 35.1±0.52ms -2.23%
Trie/cita-trie insert 1k 3.7±0.06ms 3.8±0.13ms +2.70%
Trie/ethrex-trie insert 10k 54.6±0.29ms 54.1±1.17ms -0.92%
Trie/ethrex-trie insert 1k 6.4±0.11ms 6.4±0.03ms 0.00%

Copy link

Benchmark for 999fd67

Click to view benchmark
Test Base PR %
block payload building bench 0.2±0.00ns 0.2±0.00ns 0.00%

Copy link

Benchmark for 669ac29

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 34.8±0.46ms 34.9±0.29ms +0.29%
Trie/cita-trie insert 1k 3.7±0.05ms 3.6±0.13ms -2.70%
Trie/ethrex-trie insert 10k 54.6±0.20ms 54.1±0.25ms -0.92%
Trie/ethrex-trie insert 1k 6.4±0.06ms 6.2±0.04ms -3.13%

Copy link

Benchmark for 669ac29

Click to view benchmark
Test Base PR %
block payload building bench 0.2±0.00ns 0.2±0.00ns 0.00%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L1 Ethereum client L2 Rollup client performance
Projects
Status: No status
Status: In Progress
Status: Todo
Development

Successfully merging this pull request may close these issues.

Research: branch allocation
1 participant