Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(levm): flamegraphs to l2 node for evm #1616

Merged
merged 26 commits into from
Jan 10, 2025
Merged

Conversation

LeanSerra
Copy link
Contributor

@LeanSerra LeanSerra commented Jan 3, 2025

Motivation

Generate flamegraph of ethrex client in order to test levm performance.

Description

Add the flag -c or --contract to the ethrex_l2 cli to send tx to a contract with bytecode to test the evm.

Steps to run the flamegraph (2 terminals are needed):

  1. make start-node-with-flamegraph
  2. make load-node

@ilitteri ilitteri added levm Lambda EVM implementation L2 labels Jan 6, 2025
@fborello-lambda
Copy link
Contributor

image

Steps to reproduce:

  1. cd crates/l2
sudo CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph --manifest-path ../../Cargo.toml --bin ethrex --features dev,ethrex-vm/levm,ethrex/levm,ethrex-blockchain/levm  --  --network ../../test_data/genesis-l2.json --http.port 1729

and in another terminal :
-c to load the evm with more than plain transfers.

ethrex_l2 test load --path ../../test_data/private_keys.txt -i 5000 -v  --value 1 -c

Copy link

github-actions bot commented Jan 7, 2025

Benchmark Results Comparison

PR Results

Benchmark Results: Factorial

Command Mean [s] Min [s] Max [s] Relative
revm_factorial 7.088 ± 0.026 7.064 7.150 1.00
levm_factorial 26.551 ± 0.079 26.418 26.690 3.75 ± 0.02

Benchmark Results: Fibonacci

Command Mean [s] Min [s] Max [s] Relative
revm_fibonacci 7.492 ± 0.654 7.206 9.351 1.00
levm_fibonacci 24.521 ± 0.404 24.225 25.578 3.27 ± 0.29

Main Results

Benchmark Results: Factorial

Command Mean [s] Min [s] Max [s] Relative
revm_factorial 7.426 ± 0.066 7.334 7.513 1.00
levm_factorial 26.652 ± 0.153 26.338 26.821 3.59 ± 0.04

Benchmark Results: Fibonacci

Command Mean [s] Min [s] Max [s] Relative
revm_fibonacci 7.017 ± 0.011 6.993 7.033 1.00
levm_fibonacci 24.304 ± 0.182 24.104 24.691 3.46 ± 0.03

@fborello-lambda
Copy link
Contributor

I've added a make target for the Makefile located at the root.

We can generate the flamegraph.svg with the following steps:

2 terminals are needed:

  1. make start-node-with-flamegraph
  2. make load-node

To run it with LEVM:

  1. make start-node-with-flamegraph L=1
  2. make load-node

To run it with LEVM and contract-interaction:

  1. make start-node-with-flamegraph L=1
  2. make load-node C=1

@fborello-lambda
Copy link
Contributor

I think we can take advantage of the root's Makefile, it is really convenient and easy to generate the flamegraphs. However, we may change the approach if we implement PR #1366 . We may want a way to unify the way we run the flamegraphs.

@fborello-lambda fborello-lambda marked this pull request as ready for review January 7, 2025 13:22
@fborello-lambda fborello-lambda requested a review from a team as a code owner January 7, 2025 13:22
@mpaulucci mpaulucci changed the title feat(levm): flamegraphs to l2 node for evm perf(levm): flamegraphs to l2 node for evm Jan 7, 2025
Copy link

github-actions bot commented Jan 8, 2025

+--------------------------------------------------------------------+-------+------+
| File                                                               | Lines | Diff |
+--------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/cmd/ethrex_l2/src/commands/test.rs | 184   | +37  |
+--------------------------------------------------------------------+-------+------+

Total lines changed: +37

@ilitteri ilitteri added this pull request to the merge queue Jan 10, 2025
Merged via the queue into main with commit 44d957c Jan 10, 2025
19 checks passed
@ilitteri ilitteri deleted the levm/flamegraphs_node branch January 10, 2025 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L2 levm Lambda EVM implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants