Skip to content

perf: reduce allocations on trie node decodification #3210

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 3 commits into
base: main
Choose a base branch
from

Conversation

Oppen
Copy link
Contributor

@Oppen Oppen commented Jun 18, 2025

Motivation

Description

Closes #issue_number

Copy link

Lines of code report

Total lines added: 0
Total lines removed: 2
Total lines changed: 2

Detailed view
+-----------------------------------+-------+------+
| File                              | Lines | Diff |
+-----------------------------------+-------+------+
| ethrex/crates/common/trie/node.rs | 244   | -2   |
+-----------------------------------+-------+------+

Copy link

Benchmark for 1875624

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 37.5±2.13ms 39.0±1.46ms +4.00%
Trie/cita-trie insert 1k 3.7±0.07ms 3.7±0.24ms 0.00%
Trie/ethrex-trie insert 10k 57.0±0.87ms 57.0±0.91ms 0.00%
Trie/ethrex-trie insert 1k 6.4±0.05ms 6.4±0.04ms 0.00%

Oppen added 2 commits June 18, 2025 12:56
This reverts commit b39bf42.

We need a different decoder for bounded arrays, e.g. for smallvec.
Copy link

Benchmark for 337cb2d

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 37.2±1.29ms 37.7±2.16ms +1.34%
Trie/cita-trie insert 1k 3.7±0.06ms 3.8±0.33ms +2.70%
Trie/ethrex-trie insert 10k 55.7±1.80ms 55.3±0.41ms -0.72%
Trie/ethrex-trie insert 1k 6.4±0.03ms 6.4±0.02ms 0.00%

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

Successfully merging this pull request may close these issues.

1 participant