Skip to content

Conversation

@iovoid
Copy link
Contributor

@iovoid iovoid commented Nov 14, 2025

Motivation

Currently Substate::add_accessed_slot takes about 3% of SLOAD. A couple of very similar structures also exist albeit with less impact.

Description

This switches from BTree to FxHash and always checks the current level first to prevent deep queries for hot values.

@iovoid iovoid requested a review from a team as a code owner November 14, 2025 20:17
@github-actions github-actions bot added levm Lambda EVM implementation performance Block execution throughput and performance in general labels Nov 14, 2025
@github-actions
Copy link

github-actions bot commented Nov 14, 2025

Lines of code report

Total lines added: 5
Total lines removed: 0
Total lines changed: 5

Detailed view
+---------------------------------+-------+------+
| File                            | Lines | Diff |
+---------------------------------+-------+------+
| ethrex/crates/vm/levm/src/vm.rs | 467   | +5   |
+---------------------------------+-------+------+

@github-actions
Copy link

github-actions bot commented Nov 14, 2025

Benchmark Results Comparison

No significant difference was registered for any benchmark run.

Detailed Results

Benchmark Results: BubbleSort

Command Mean [s] Min [s] Max [s] Relative
main_revm_BubbleSort 2.978 ± 0.022 2.953 3.022 1.00 ± 0.01
main_levm_BubbleSort 3.068 ± 0.167 2.959 3.517 1.03 ± 0.06
pr_revm_BubbleSort 2.969 ± 0.011 2.955 2.984 1.00
pr_levm_BubbleSort 3.011 ± 0.075 2.968 3.221 1.01 ± 0.03

Benchmark Results: ERC20Approval

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Approval 980.7 ± 6.8 969.0 994.4 1.00
main_levm_ERC20Approval 1080.8 ± 12.5 1064.9 1106.0 1.10 ± 0.01
pr_revm_ERC20Approval 981.5 ± 2.7 977.4 985.4 1.00 ± 0.01
pr_levm_ERC20Approval 1074.0 ± 17.6 1056.4 1113.2 1.10 ± 0.02

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 138.1 ± 0.7 137.3 139.5 1.02 ± 0.01
main_levm_ERC20Mint 168.5 ± 2.2 165.9 172.7 1.25 ± 0.02
pr_revm_ERC20Mint 135.1 ± 0.7 133.9 136.0 1.00
pr_levm_ERC20Mint 167.3 ± 5.7 164.0 183.0 1.24 ± 0.04

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 241.4 ± 27.0 232.1 318.2 1.04 ± 0.12
main_levm_ERC20Transfer 277.2 ± 4.3 272.1 288.0 1.20 ± 0.02
pr_revm_ERC20Transfer 231.0 ± 2.6 228.9 236.0 1.00
pr_levm_ERC20Transfer 273.7 ± 3.5 269.3 278.5 1.19 ± 0.02

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 226.8 ± 3.6 224.8 236.8 1.00
main_levm_Factorial 267.1 ± 4.9 262.1 279.1 1.18 ± 0.03
pr_revm_Factorial 228.6 ± 11.0 223.7 259.9 1.01 ± 0.05
pr_levm_Factorial 269.2 ± 8.4 264.5 291.7 1.19 ± 0.04

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.603 ± 0.070 1.415 1.665 1.00
main_levm_FactorialRecursive 8.239 ± 0.147 7.996 8.543 5.14 ± 0.24
pr_revm_FactorialRecursive 1.614 ± 0.037 1.560 1.675 1.01 ± 0.05
pr_levm_FactorialRecursive 8.384 ± 0.123 8.143 8.508 5.23 ± 0.24

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 205.4 ± 1.4 204.3 209.1 1.00 ± 0.01
main_levm_Fibonacci 256.0 ± 2.7 250.9 259.2 1.25 ± 0.01
pr_revm_Fibonacci 204.5 ± 0.7 203.2 205.6 1.00
pr_levm_Fibonacci 266.5 ± 26.9 252.4 342.4 1.30 ± 0.13

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 849.5 ± 9.1 837.1 863.8 1.19 ± 0.02
main_levm_FibonacciRecursive 717.2 ± 6.3 711.0 731.0 1.01 ± 0.02
pr_revm_FibonacciRecursive 841.7 ± 8.2 829.1 856.6 1.18 ± 0.02
pr_levm_FibonacciRecursive 713.0 ± 8.8 705.2 736.3 1.00

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 8.3 ± 0.1 8.2 8.4 1.01 ± 0.01
main_levm_ManyHashes 9.3 ± 0.1 9.1 9.4 1.13 ± 0.01
pr_revm_ManyHashes 8.2 ± 0.1 8.1 8.3 1.00
pr_levm_ManyHashes 9.1 ± 0.2 8.9 9.5 1.10 ± 0.02

Benchmark Results: MstoreBench

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_MstoreBench 257.6 ± 3.9 255.3 268.5 1.07 ± 0.02
main_levm_MstoreBench 239.7 ± 1.6 237.9 243.1 1.00
pr_revm_MstoreBench 258.5 ± 5.4 254.7 272.1 1.08 ± 0.02
pr_levm_MstoreBench 241.0 ± 2.1 238.4 245.6 1.01 ± 0.01

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 292.0 ± 0.8 291.1 293.4 1.00
main_levm_Push 309.6 ± 2.6 306.1 315.3 1.06 ± 0.01
pr_revm_Push 294.5 ± 3.1 291.7 301.3 1.01 ± 0.01
pr_levm_Push 309.4 ± 1.2 307.8 311.7 1.06 ± 0.00

Benchmark Results: SstoreBench_no_opt

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_SstoreBench_no_opt 173.4 ± 8.1 165.3 195.2 1.74 ± 0.10
main_levm_SstoreBench_no_opt 100.6 ± 4.3 96.2 108.6 1.01 ± 0.05
pr_revm_SstoreBench_no_opt 170.0 ± 3.7 164.8 173.3 1.71 ± 0.07
pr_levm_SstoreBench_no_opt 99.5 ± 3.3 96.0 108.3 1.00

@github-actions
Copy link

github-actions bot commented Nov 14, 2025

Benchmark Block Execution Results Comparison Against Main

Command Mean [s] Min [s] Max [s] Relative
base 63.666 ± 0.339 63.180 64.244 1.01 ± 0.01
head 63.298 ± 0.395 62.923 64.237 1.00

@github-project-automation github-project-automation bot moved this to In Review 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

levm Lambda EVM implementation performance Block execution throughput and performance in general

Projects

Status: In Review
Status: Todo

Development

Successfully merging this pull request may close these issues.

5 participants