Skip to content

Conversation

@JereSalo
Copy link
Contributor

@JereSalo JereSalo commented Nov 7, 2025

Motivation

Description

  • Try see if there's any improvement if we stop using U512 for these operations. We executed with a zkVM and we saw that it can be a bottleneck. This is experimental

WARNING: This is VERY experimental, it probably won't be merged so don't bother to review this for now haha

@github-actions
Copy link

github-actions bot commented Nov 7, 2025

Lines of code report

Total lines added: 9
Total lines removed: 0
Total lines changed: 9

Detailed view
+---------------------------------------------------------+-------+------+
| File                                                    | Lines | Diff |
+---------------------------------------------------------+-------+------+
| ethrex/crates/vm/levm/src/opcode_handlers/arithmetic.rs | 221   | +9   |
+---------------------------------------------------------+-------+------+

@github-actions
Copy link

github-actions bot commented Nov 7, 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.982 ± 0.067 2.946 3.170 1.00
main_levm_BubbleSort 3.201 ± 0.009 3.188 3.217 1.07 ± 0.02
pr_revm_BubbleSort 3.043 ± 0.018 3.015 3.068 1.02 ± 0.02
pr_levm_BubbleSort 3.243 ± 0.051 3.217 3.386 1.09 ± 0.03

Benchmark Results: ERC20Approval

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Approval 968.4 ± 6.0 957.2 977.4 1.00
main_levm_ERC20Approval 1176.2 ± 18.8 1155.3 1213.2 1.21 ± 0.02
pr_revm_ERC20Approval 1002.8 ± 8.4 992.8 1022.3 1.04 ± 0.01
pr_levm_ERC20Approval 1161.1 ± 18.2 1149.5 1207.4 1.20 ± 0.02

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 131.8 ± 1.1 130.9 135.0 1.00
main_levm_ERC20Mint 170.5 ± 4.1 166.3 178.4 1.29 ± 0.03
pr_revm_ERC20Mint 136.9 ± 1.8 135.2 141.1 1.04 ± 0.02
pr_levm_ERC20Mint 170.0 ± 2.0 167.9 174.7 1.29 ± 0.02

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 231.7 ± 2.6 229.3 236.1 1.00
main_levm_ERC20Transfer 287.9 ± 2.8 283.7 294.5 1.24 ± 0.02
pr_revm_ERC20Transfer 243.2 ± 11.0 235.8 271.1 1.05 ± 0.05
pr_levm_ERC20Transfer 287.4 ± 1.7 285.1 290.1 1.24 ± 0.02

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 225.5 ± 3.2 223.1 231.5 1.00
main_levm_Factorial 275.6 ± 11.6 269.8 308.1 1.22 ± 0.05
pr_revm_Factorial 226.9 ± 8.5 221.4 248.8 1.01 ± 0.04
pr_levm_Factorial 274.8 ± 12.3 269.8 309.7 1.22 ± 0.06

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.609 ± 0.030 1.566 1.652 1.00
main_levm_FactorialRecursive 8.629 ± 0.108 8.488 8.879 5.36 ± 0.12
pr_revm_FactorialRecursive 1.624 ± 0.028 1.584 1.684 1.01 ± 0.03
pr_levm_FactorialRecursive 8.618 ± 0.064 8.531 8.709 5.35 ± 0.11

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 203.9 ± 0.8 202.6 205.2 1.00 ± 0.00
main_levm_Fibonacci 268.7 ± 13.5 257.0 304.4 1.32 ± 0.07
pr_revm_Fibonacci 203.2 ± 0.5 202.5 203.9 1.00
pr_levm_Fibonacci 260.4 ± 3.0 257.3 267.5 1.28 ± 0.02

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 829.6 ± 8.9 817.2 841.6 1.10 ± 0.02
main_levm_FibonacciRecursive 754.8 ± 8.0 748.1 773.0 1.00
pr_revm_FibonacciRecursive 834.2 ± 8.1 826.2 850.2 1.11 ± 0.02
pr_levm_FibonacciRecursive 768.9 ± 26.7 731.4 832.7 1.02 ± 0.04

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 8.2 ± 0.0 8.2 8.3 1.00
main_levm_ManyHashes 9.6 ± 0.1 9.5 9.8 1.17 ± 0.01
pr_revm_ManyHashes 8.3 ± 0.1 8.2 8.6 1.01 ± 0.02
pr_levm_ManyHashes 9.6 ± 0.1 9.5 9.8 1.17 ± 0.01

Benchmark Results: MstoreBench

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_MstoreBench 262.3 ± 1.2 261.0 265.5 1.09 ± 0.03
main_levm_MstoreBench 241.8 ± 6.0 235.6 256.6 1.01 ± 0.04
pr_revm_MstoreBench 264.8 ± 3.9 260.9 272.1 1.10 ± 0.03
pr_levm_MstoreBench 240.0 ± 6.0 236.1 254.3 1.00

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 295.6 ± 3.9 292.2 303.6 1.01 ± 0.01
main_levm_Push 318.3 ± 1.6 317.2 322.7 1.08 ± 0.01
pr_revm_Push 294.1 ± 2.0 292.0 298.7 1.00
pr_levm_Push 314.8 ± 1.6 313.3 318.1 1.07 ± 0.01

Benchmark Results: SstoreBench_no_opt

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_SstoreBench_no_opt 167.0 ± 6.4 161.0 176.7 1.89 ± 0.08
main_levm_SstoreBench_no_opt 89.8 ± 3.9 86.7 97.6 1.02 ± 0.05
pr_revm_SstoreBench_no_opt 165.5 ± 4.9 161.3 175.4 1.87 ± 0.06
pr_levm_SstoreBench_no_opt 88.4 ± 1.5 86.7 92.4 1.00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

levm Lambda EVM implementation performance

Projects

Status: No status
Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants