Skip to content

Commit 3e4d1e8

Browse files
edg-lMegaRedHand
andauthored
perf(l1): improve rlp encoding (#5350)
**Motivation** - In the current impl_encode there are 2 loops to get the position, fixed to a single pass. - Added specialized branchless length methods to integers, - Added specialized length to Vec<T> - Added specialized length to tuples - Added specialized length to most types in ethrex-common, only ones missing are in networking/p2p - Removed unneeded arrayvec usage - Many instances that deref to &[u8] didn't use its length specialized method, fixed to use it Each missing length impl in the trait impl meant an extra allocation, this should remove them entirely when encoding Helps with #4956 --------- Co-authored-by: Tomás Grüner <47506558+MegaRedHand@users.noreply.github.com>
1 parent 7b4a0ba commit 3e4d1e8

File tree

3 files changed

+507
-160
lines changed

3 files changed

+507
-160
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Perf
44

5+
### 2025-11-20
6+
7+
- Improve rlp encoding by avoiding extra loops and remove unneeded array vec, also adding a alloc-less length method the default trait impl [#5350](https://github.com/lambdaclass/ethrex/pull/5350)
8+
59
### 2025-11-19
610

711
- Parallelize merkleization [#5377](https://github.com/lambdaclass/ethrex/pull/5377)

0 commit comments

Comments
 (0)