Skip to content

Conversation

@edg-l
Copy link
Contributor

@edg-l edg-l commented Nov 17, 2025

Motivation

Followup on #5350 since its already a big pr.

Changed:

  • Replaced encode_to_vec().len() calls with length()
  • Added more tests

@github-actions github-actions bot added L1 Ethereum client performance Block execution throughput and performance in general labels Nov 17, 2025
@github-actions
Copy link

github-actions bot commented Nov 17, 2025

Lines of code report

Total lines added: 3
Total lines removed: 2
Total lines changed: 5

Detailed view
+---------------------------------------------+-------+------+
| File                                        | Lines | Diff |
+---------------------------------------------+-------+------+
| ethrex/crates/common/types/block.rs         | 885   | +2   |
+---------------------------------------------+-------+------+
| ethrex/crates/common/types/transaction.rs   | 3208  | +1   |
+---------------------------------------------+-------+------+
| ethrex/crates/networking/rpc/types/block.rs | 200   | -2   |
+---------------------------------------------+-------+------+

@github-actions
Copy link

github-actions bot commented Nov 17, 2025

Benchmark Results Comparison

Benchmark Results: MstoreBench

Command Mean [s] Min [s] Max [s] Relative
main_revm_MstoreBench 264.8 ± 6.2 258.8 275.5 1.10 ± 0.03
main_levm_MstoreBench 240.9 ± 1.5 238.3 242.9 1.00
pr_revm_MstoreBench 296.2 ± 107.6 258.3 602.1 1.23 ± 0.45
Detailed Results

Benchmark Results: BubbleSort

Command Mean [s] Min [s] Max [s] Relative
main_revm_BubbleSort 2.958 ± 0.022 2.932 2.997 1.00 ± 0.01
main_levm_BubbleSort 3.131 ± 0.025 3.106 3.177 1.06 ± 0.01
pr_revm_BubbleSort 2.952 ± 0.018 2.936 2.991 1.00
pr_levm_BubbleSort 3.123 ± 0.010 3.109 3.142 1.06 ± 0.01

Benchmark Results: ERC20Approval

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Approval 967.4 ± 12.3 959.7 996.4 1.00
main_levm_ERC20Approval 1085.0 ± 8.4 1071.1 1104.2 1.12 ± 0.02
pr_revm_ERC20Approval 975.1 ± 18.4 961.5 1024.1 1.01 ± 0.02
pr_levm_ERC20Approval 1091.6 ± 4.6 1086.1 1103.6 1.13 ± 0.02

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 131.9 ± 0.8 130.4 133.1 1.00 ± 0.01
main_levm_ERC20Mint 162.9 ± 1.1 161.5 164.6 1.24 ± 0.01
pr_revm_ERC20Mint 131.3 ± 1.1 130.0 133.3 1.00
pr_levm_ERC20Mint 163.3 ± 2.5 160.9 168.7 1.24 ± 0.02

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 231.1 ± 4.0 228.1 241.6 1.00 ± 0.02
main_levm_ERC20Transfer 278.8 ± 5.2 273.6 290.5 1.21 ± 0.03
pr_revm_ERC20Transfer 230.8 ± 3.4 227.2 238.7 1.00
pr_levm_ERC20Transfer 279.2 ± 3.4 275.3 286.0 1.21 ± 0.02

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 225.5 ± 0.6 224.2 226.0 1.00
main_levm_Factorial 271.9 ± 7.7 268.0 293.6 1.21 ± 0.03
pr_revm_Factorial 228.1 ± 6.6 223.9 240.9 1.01 ± 0.03
pr_levm_Factorial 273.8 ± 1.3 272.0 276.3 1.21 ± 0.01

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.654 ± 0.060 1.527 1.730 1.00
main_levm_FactorialRecursive 8.318 ± 0.054 8.242 8.434 5.03 ± 0.19
pr_revm_FactorialRecursive 1.663 ± 0.035 1.617 1.719 1.01 ± 0.04
pr_levm_FactorialRecursive 8.278 ± 0.048 8.229 8.395 5.01 ± 0.18

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 205.8 ± 0.3 205.3 206.3 1.00
main_levm_Fibonacci 266.8 ± 1.9 264.2 269.0 1.30 ± 0.01
pr_revm_Fibonacci 206.3 ± 1.9 205.1 211.5 1.00 ± 0.01
pr_levm_Fibonacci 265.7 ± 5.3 253.9 275.3 1.29 ± 0.03

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 888.2 ± 32.5 866.1 974.3 1.16 ± 0.05
main_levm_FibonacciRecursive 767.6 ± 11.0 752.4 788.5 1.00
pr_revm_FibonacciRecursive 876.1 ± 8.9 868.5 899.2 1.14 ± 0.02
pr_levm_FibonacciRecursive 778.3 ± 89.0 744.8 1031.3 1.01 ± 0.12

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 8.2 ± 0.1 8.1 8.3 1.00
main_levm_ManyHashes 9.0 ± 0.2 8.9 9.4 1.09 ± 0.02
pr_revm_ManyHashes 8.2 ± 0.1 8.2 8.3 1.00 ± 0.01
pr_levm_ManyHashes 8.9 ± 0.1 8.8 9.3 1.09 ± 0.02

Benchmark Results: MstoreBench

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_MstoreBench 264.8 ± 6.2 258.8 275.5 1.10 ± 0.03
main_levm_MstoreBench 240.9 ± 1.5 238.3 242.9 1.00
pr_revm_MstoreBench 296.2 ± 107.6 258.3 602.1 1.23 ± 0.45
pr_levm_MstoreBench 242.7 ± 2.8 239.7 247.4 1.01 ± 0.01

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 318.1 ± 71.8 291.5 522.2 1.07 ± 0.24
main_levm_Push 316.4 ± 22.0 304.6 377.2 1.07 ± 0.07
pr_revm_Push 297.1 ± 2.2 294.5 302.3 1.00
pr_levm_Push 305.5 ± 3.6 299.8 313.4 1.03 ± 0.01

Benchmark Results: SstoreBench_no_opt

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_SstoreBench_no_opt 166.3 ± 2.2 160.6 168.5 1.88 ± 0.03
main_levm_SstoreBench_no_opt 90.7 ± 3.5 87.5 99.0 1.03 ± 0.04
pr_revm_SstoreBench_no_opt 166.1 ± 4.3 160.3 172.7 1.88 ± 0.05
pr_levm_SstoreBench_no_opt 88.2 ± 0.4 87.7 89.0 1.00

@github-actions
Copy link

github-actions bot commented Nov 17, 2025

Benchmark Block Execution Results Comparison Against Main

Command Mean [s] Min [s] Max [s] Relative
base 61.504 ± 0.275 61.194 62.005 1.00
head 61.532 ± 0.314 61.066 61.934 1.00 ± 0.01

let size = Block::new(header.clone(), body.clone())
.encode_to_vec()
.len();
let size = Block::new(header.clone(), body.clone()).length();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this can be done without cloning header and body. Not for this PR.

Maybe something like:

let tmp_block = Block::new(header, body);
let size = tmp_block.length();
let (header, body) = (tmp_block.header, tmp_block.body);

Ugly but I think should work.

@edg-l edg-l changed the base branch from rlp_improve_encode to main November 26, 2025 13:45
@edg-l edg-l changed the base branch from main to rlp_improve_encode November 26, 2025 13:46
Base automatically changed from rlp_improve_encode to main November 27, 2025 15:16
@edg-l edg-l enabled auto-merge November 28, 2025 07:34
@edg-l edg-l added this pull request to the merge queue Nov 28, 2025
Merged via the queue into main with commit fcbbbb3 Nov 28, 2025
55 checks passed
@edg-l edg-l deleted the rlp_improve_encode_part2 branch November 28, 2025 08:39
@github-project-automation github-project-automation bot moved this from In review to Done in ethrex_performance Nov 28, 2025
@github-project-automation github-project-automation bot moved this from In Review to Done in ethrex_l1 Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L1 Ethereum client performance Block execution throughput and performance in general

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants