Skip to content

Conversation

@edg-l
Copy link
Contributor

@edg-l edg-l commented Jan 7, 2026

Motivation

Perf experiment, change btree to fxhash

Closes #5757

I would say there is no relevant change in performance

image

Improvements

  • Memory access with large memory expansion: ~1.21× faster
  • CODECOPY (fixed src/dst, 0.25× max code size): ~1.19× faster
  • Additional memory expansion paths: ~1.12× faster
  • Arithmetic ops:
    • MOD (various bit widths): ~1.08–1.12× faster
    • DIV: ~1.11× faster
  • CALLDATACOPY (various non-zero data patterns): ~1.09–1.11× faster

Regressions

  • CALLDATACOPY (other data/layout patterns): ~1.19–1.22× slower
  • Initcode JUMPDEST analysis: ~1.17× slower
  • JUMPDESTS: ~1.14× slower
  • RETURNDATACOPY: ~1.14× slower
  • CODECOPY (fixed src/dst, 0.75× max code size): ~1.14× slower
  • CALLDATASIZE (various lengths): ~1.12–1.13× slower
  • SWAP1: ~1.12× slower

@github-actions github-actions bot added levm Lambda EVM implementation performance Block execution throughput and performance in general labels Jan 7, 2026
@edg-l edg-l removed this from ethrex_l1 Jan 7, 2026
@github-actions
Copy link

github-actions bot commented Jan 7, 2026

Lines of code report

Total lines added: 1
Total lines removed: 0
Total lines changed: 1

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

@github-actions
Copy link

github-actions bot commented Jan 7, 2026

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.798 ± 0.025 2.775 2.863 1.00 ± 0.01
main_levm_BubbleSort 2.892 ± 0.031 2.870 2.974 1.04 ± 0.01
pr_revm_BubbleSort 2.789 ± 0.015 2.775 2.824 1.00
pr_levm_BubbleSort 2.887 ± 0.017 2.872 2.930 1.04 ± 0.01

Benchmark Results: ERC20Approval

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Approval 910.4 ± 11.7 901.9 936.2 1.00 ± 0.01
main_levm_ERC20Approval 1055.5 ± 5.0 1052.2 1069.5 1.16 ± 0.01
pr_revm_ERC20Approval 907.8 ± 5.4 903.4 919.6 1.00
pr_levm_ERC20Approval 1057.3 ± 4.5 1052.6 1066.3 1.16 ± 0.01

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 119.8 ± 0.7 119.3 121.6 1.00
main_levm_ERC20Mint 161.7 ± 1.2 160.2 163.7 1.35 ± 0.01
pr_revm_ERC20Mint 119.9 ± 1.0 119.2 122.0 1.00 ± 0.01
pr_levm_ERC20Mint 161.6 ± 1.0 159.7 163.6 1.35 ± 0.01

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 214.1 ± 1.2 213.0 216.4 1.00 ± 0.01
main_levm_ERC20Transfer 270.5 ± 1.9 268.8 274.2 1.26 ± 0.01
pr_revm_ERC20Transfer 214.0 ± 0.7 213.1 215.3 1.00
pr_levm_ERC20Transfer 271.2 ± 3.8 268.8 281.4 1.27 ± 0.02

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 183.5 ± 1.6 181.7 187.1 1.00 ± 0.01
main_levm_Factorial 235.2 ± 3.3 232.9 242.3 1.28 ± 0.02
pr_revm_Factorial 183.2 ± 1.4 181.4 186.3 1.00
pr_levm_Factorial 236.5 ± 5.0 233.1 247.8 1.29 ± 0.03

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.347 ± 0.015 1.320 1.368 1.01 ± 0.02
main_levm_FactorialRecursive 6.341 ± 0.054 6.261 6.396 4.75 ± 0.09
pr_revm_FactorialRecursive 1.335 ± 0.022 1.314 1.377 1.00
pr_levm_FactorialRecursive 6.362 ± 0.053 6.272 6.433 4.76 ± 0.09

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 153.3 ± 3.5 151.2 163.0 1.00 ± 0.03
main_levm_Fibonacci 219.9 ± 3.6 215.5 223.8 1.44 ± 0.03
pr_revm_Fibonacci 152.9 ± 1.8 151.5 157.7 1.00
pr_levm_Fibonacci 217.1 ± 2.6 215.3 224.1 1.42 ± 0.02

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 726.3 ± 7.0 716.5 737.2 1.19 ± 0.04
main_levm_FibonacciRecursive 608.9 ± 17.1 581.4 625.8 1.00
pr_revm_FibonacciRecursive 720.8 ± 3.7 713.3 724.7 1.18 ± 0.03
pr_levm_FibonacciRecursive 610.9 ± 8.3 587.9 617.3 1.00 ± 0.03

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 7.8 ± 0.0 7.7 7.8 1.00 ± 0.01
main_levm_ManyHashes 8.7 ± 0.2 8.5 9.1 1.12 ± 0.02
pr_revm_ManyHashes 7.8 ± 0.1 7.7 7.9 1.00
pr_levm_ManyHashes 8.9 ± 0.3 8.6 9.3 1.14 ± 0.04

Benchmark Results: MstoreBench

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_MstoreBench 257.1 ± 1.0 255.6 258.4 1.22 ± 0.01
main_levm_MstoreBench 211.2 ± 1.4 208.9 213.3 1.00 ± 0.01
pr_revm_MstoreBench 260.6 ± 10.3 256.5 289.8 1.24 ± 0.05
pr_levm_MstoreBench 210.5 ± 1.0 209.2 212.1 1.00

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 242.9 ± 1.6 241.0 246.0 1.01 ± 0.01
main_levm_Push 240.9 ± 1.7 239.3 245.6 1.00
pr_revm_Push 242.3 ± 0.5 241.4 242.9 1.01 ± 0.01
pr_levm_Push 243.1 ± 4.0 240.2 253.9 1.01 ± 0.02

Benchmark Results: SstoreBench_no_opt

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_SstoreBench_no_opt 147.4 ± 8.2 142.4 169.3 1.51 ± 0.08
main_levm_SstoreBench_no_opt 97.4 ± 0.7 96.5 98.5 1.00
pr_revm_SstoreBench_no_opt 147.3 ± 4.2 142.9 156.1 1.51 ± 0.04
pr_levm_SstoreBench_no_opt 98.8 ± 3.0 96.5 106.7 1.01 ± 0.03

@edg-l edg-l closed this Jan 13, 2026
@github-project-automation github-project-automation bot moved this from Todo to Done in ethrex_performance Jan 13, 2026
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: Done

Development

Successfully merging this pull request may close these issues.

Replace BTreeMap/BTreeSet with FxHashMap/FxHashSet

3 participants