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

fix: PUSH, DUP, SWAP on the EVM interpreter #21

Merged
merged 2 commits into from
May 15, 2024

Conversation

hedgar2017
Copy link
Collaborator

What ❔

Tests fixes for PUSH, DUP, SWAP on the EVM interpreter.

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • Code has been formatted via cargo fmt and checked with cargo clippy.

Copy link

Benchmark results:

╔═╡ Size (-%) ╞════════════════╡ All M3B3 ╞═╗
║ Mean                                1.456 ║
║ Best                               92.378 ║
║ Worst                               0.000 ║
║ Total                               0.245 ║
╠═╡ Cycles (-%) ╞══════════════╡ All M3B3 ╞═╣
║ Mean                                0.198 ║
║ Best                               58.424 ║
║ Worst                              -2.184 ║
║ Total                               0.252 ║
╠═╡ Ergs (-%) ╞════════════════╡ All M3B3 ╞═╣
║ Mean                                0.037 ║
║ Best                               28.780 ║
║ Worst                              -1.326 ║
║ Total                               0.000 ║
╚═══════════════════════════════════════════╝

╔═╡ Size (-%) ╞════════════════╡ All MzB3 ╞═╗
║ Mean                                1.456 ║
║ Best                               92.378 ║
║ Worst                               0.000 ║
║ Total                               0.258 ║
╠═╡ Cycles (-%) ╞══════════════╡ All MzB3 ╞═╣
║ Mean                                0.198 ║
║ Best                               58.327 ║
║ Worst                              -2.184 ║
║ Total                               0.229 ║
╠═╡ Ergs (-%) ╞════════════════╡ All MzB3 ╞═╣
║ Mean                                0.037 ║
║ Best                               28.769 ║
║ Worst                              -1.326 ║
║ Total                               0.000 ║
╚═══════════════════════════════════════════╝

╔═╡ Size (-%) ╞═════╡ EVMInterpreter M3B3 ╞═╗
║ Mean                               64.745 ║
║ Best                               92.378 ║
║ Worst                               0.000 ║
║ Total                              44.263 ║
╠═╡ Cycles (-%) ╞═══╡ EVMInterpreter M3B3 ╞═╣
║ Mean                               20.508 ║
║ Best                               58.424 ║
║ Worst                              -2.184 ║
║ Total                              21.819 ║
╠═╡ Ergs (-%) ╞═════╡ EVMInterpreter M3B3 ╞═╣
║ Mean                                4.197 ║
║ Best                               28.780 ║
║ Worst                              -1.326 ║
║ Total                               4.822 ║
╠═╡ Ergs/gas ╞══════╡ EVMInterpreter M3B3 ╞═╣
║ ADD                                67.667 ║
║ MUL                                39.400 ║
║ SUB                                67.667 ║
║ DIV                                47.800 ║
║ SDIV                               64.600 ║
║ MOD                                46.600 ║
║ SMOD                               62.200 ║
║ ADDMOD                             39.000 ║
║ MULMOD                             36.000 ║
║ EXP                                 9.283 ║
║ SIGNEXTEND                         45.400 ║
║ LT                                 71.667 ║
║ GT                                 71.667 ║
║ SLT                                95.667 ║
║ SGT                                93.667 ║
║ EQ                                 71.667 ║
║ ISZERO                             63.333 ║
║ AND                                65.667 ║
║ OR                                 67.667 ║
║ XOR                                67.667 ║
║ NOT                                59.333 ║
║ BYTE                               75.667 ║
║ SHL                                73.667 ║
║ SHR                                71.667 ║
║ SAR                                89.667 ║
║ SGT                                93.667 ║
║ SHA3                               27.139 ║
║ ADDRESS                            91.000 ║
║ BALANCE                            73.180 ║
║ ORIGIN                           2852.000 ║
║ CALLER                             91.000 ║
║ CALLVALUE                          91.000 ║
║ BLOCKHASH                         244.450 ║
║ COINBASE                         2849.000 ║
║ TIMESTAMP                        2843.000 ║
║ NUMBER                           2843.000 ║
║ PREVRANDAO                       2843.000 ║
║ GASLIMIT                         2849.000 ║
║ CHAINID                          2837.000 ║
║ SELFBALANCE                       640.200 ║
║ BASEFEE                          2840.000 ║
║ POP                                79.000 ║
║ MLOAD                              43.667 ║
║ MSTORE                             44.333 ║
║ MSTORE8                            47.111 ║
║ SLOAD                               5.766 ║
║ SSTORE                              0.621 ║
║ JUMP                               37.333 ║
║ JUMPI                              32.818 ║
║ PC                                 91.500 ║
║ MSIZE                             101.000 ║
║ GAS                                85.500 ║
║ JUMPDEST                          122.000 ║
║ RETURN                                inf ║
║ REVERT                                inf ║
╠═╡ Ergs/gas (-%) ╞═╡ EVMInterpreter M3B3 ╞═╣
║ SHA3                                4.125 ║
║ MLOAD                              42.248 ║
║ MSTORE                             42.714 ║
║ MSTORE8                            44.442 ║
║ SLOAD                              80.255 ║
║ SSTORE                             87.573 ║
╚═══════════════════════════════════════════╝

╔═╡ Size (-%) ╞═════╡ EVMInterpreter MzB3 ╞═╗
║ Mean                               64.745 ║
║ Best                               92.378 ║
║ Worst                               0.000 ║
║ Total                              41.229 ║
╠═╡ Cycles (-%) ╞═══╡ EVMInterpreter MzB3 ╞═╣
║ Mean                               20.484 ║
║ Best                               58.327 ║
║ Worst                              -2.184 ║
║ Total                              21.792 ║
╠═╡ Ergs (-%) ╞═════╡ EVMInterpreter MzB3 ╞═╣
║ Mean                                4.196 ║
║ Best                               28.769 ║
║ Worst                              -1.326 ║
║ Total                               4.821 ║
╚═══════════════════════════════════════════╝

╔═╡ Size (-%) ╞════════╡ Precompiles M3B3 ╞═╗
║ Mean                                0.000 ║
║ Best                                0.000 ║
║ Worst                               0.000 ║
║ Total                               0.000 ║
╠═╡ Cycles (-%) ╞══════╡ Precompiles M3B3 ╞═╣
║ Mean                                0.000 ║
║ Best                                0.000 ║
║ Worst                               0.000 ║
║ Total                               0.000 ║
╠═╡ Ergs (-%) ╞════════╡ Precompiles M3B3 ╞═╣
║ Mean                                0.000 ║
║ Best                                0.000 ║
║ Worst                               0.000 ║
║ Total                               0.000 ║
╚═══════════════════════════════════════════╝

╔═╡ Size (-%) ╞════════╡ Precompiles MzB3 ╞═╗
║ Mean                                0.000 ║
║ Best                                0.000 ║
║ Worst                               0.000 ║
║ Total                               0.000 ║
╠═╡ Cycles (-%) ╞══════╡ Precompiles MzB3 ╞═╣
║ Mean                                0.000 ║
║ Best                                0.000 ║
║ Worst                               0.000 ║
║ Total                               0.000 ║
╠═╡ Ergs (-%) ╞════════╡ Precompiles MzB3 ╞═╣
║ Mean                                0.000 ║
║ Best                                0.000 ║
║ Worst                               0.000 ║
║ Total                               0.000 ║
╚═══════════════════════════════════════════╝

╔═╡ Size (-%) ╞══════════╡ Real life M3B3 ╞═╗
║ Mean                                0.000 ║
║ Best                                0.000 ║
║ Worst                               0.000 ║
║ Total                               0.000 ║
╠═╡ Cycles (-%) ╞════════╡ Real life M3B3 ╞═╣
║ Mean                                0.000 ║
║ Best                                0.000 ║
║ Worst                               0.000 ║
║ Total                               0.000 ║
╠═╡ Ergs (-%) ╞══════════╡ Real life M3B3 ╞═╣
║ Mean                                0.000 ║
║ Best                                0.000 ║
║ Worst                               0.000 ║
║ Total                               0.000 ║
╚═══════════════════════════════════════════╝

╔═╡ Size (-%) ╞══════════╡ Real life MzB3 ╞═╗
║ Mean                                0.000 ║
║ Best                                0.000 ║
║ Worst                               0.000 ║
║ Total                               0.000 ║
╠═╡ Cycles (-%) ╞════════╡ Real life MzB3 ╞═╣
║ Mean                                0.000 ║
║ Best                                0.000 ║
║ Worst                               0.000 ║
║ Total                               0.000 ║
╠═╡ Ergs (-%) ╞══════════╡ Real life MzB3 ╞═╣
║ Mean                                0.000 ║
║ Best                                0.000 ║
║ Worst                               0.000 ║
║ Total                               0.000 ║
╚═══════════════════════════════════════════╝

@hedgar2017 hedgar2017 marked this pull request as ready for review May 15, 2024 07:58
@hedgar2017 hedgar2017 merged commit 302b320 into main May 15, 2024
6 checks passed
@hedgar2017 hedgar2017 deleted the az-fix-evm-intr-push-swap-dup branch May 15, 2024 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant