Skip to content

precompiles: Optimize EC point multiplication#1166

Merged
chfast merged 1 commit into
masterfrom
precompiles/ecmul
Mar 14, 2025
Merged

precompiles: Optimize EC point multiplication#1166
chfast merged 1 commit into
masterfrom
precompiles/ecmul

Conversation

@chfast

@chfast chfast commented Mar 13, 2025

Copy link
Copy Markdown
Member

Simplify and optimize the procedure for EC point multiplication. This reduced EC point multiplication time by 30%.

Comparing o/ec to o/ec-mulopt
Benchmark                                                                  Time             CPU      Time Old      Time New       CPU Old       CPU New
-------------------------------------------------------------------------------------------------------------------------------------------------------
precompile<PrecompileId::ecrecover, evmmax_cpp>_mean                    -0.2961         -0.2960        312197        219765        312126        219741
precompile<PrecompileId::ecmul, evmmax_cpp>_mean                        -0.3179         -0.3180        144903         98842        144882         98814

@chfast chfast requested a review from rodiazet March 13, 2025 09:53
@chfast chfast added the precompiles Related to EVM precompiles label Mar 13, 2025
@codecov

codecov Bot commented Mar 13, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.48%. Comparing base (07f1fd7) to head (72ef246).
Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1166       +/-   ##
===========================================
+ Coverage   31.23%   94.48%   +63.25%     
===========================================
  Files         169      169               
  Lines       18020    18014        -6     
===========================================
+ Hits         5628    17021    +11393     
+ Misses      12392      993    -11399     
Flag Coverage Δ
eof_execution_spec_tests 20.89% <0.00%> (+<0.01%) ⬆️
ethereum_tests 27.07% <100.00%> (-0.03%) ⬇️
ethereum_tests_silkpre 19.53% <100.00%> (-0.03%) ⬇️
execution_spec_tests 21.25% <0.00%> (+<0.01%) ⬆️
unittests 91.66% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
lib/evmone_precompiles/ecc.hpp 100.00% <100.00%> (ø)

... and 112 files with indirect coverage changes

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chfast chfast requested review from gumb0 and pdobacz March 14, 2025 10:07
Simplify and optimize the procedure for EC point multiplication.
This reduced EC point multiplication time by 30%.

```
Comparing o/ec to o/ec-mulopt
Benchmark                                                                  Time             CPU      Time Old      Time New       CPU Old       CPU New
-------------------------------------------------------------------------------------------------------------------------------------------------------
precompile<PrecompileId::ecrecover, evmmax_cpp>_mean                    -0.2961         -0.2960        312197        219765        312126        219741
precompile<PrecompileId::ecmul, evmmax_cpp>_mean                        -0.3179         -0.3180        144903         98842        144882         98814
```
@chfast chfast force-pushed the precompiles/ecmul branch from ad6a7aa to 72ef246 Compare March 14, 2025 14:57
@chfast chfast enabled auto-merge (squash) March 14, 2025 14:57
@chfast chfast merged commit 26cdd85 into master Mar 14, 2025
@chfast chfast deleted the precompiles/ecmul branch March 14, 2025 15:18
gumb0 pushed a commit that referenced this pull request Mar 20, 2025
Simplify and optimize the procedure for EC point multiplication. This
reduced EC point multiplication time by 30%.

```
Comparing o/ec to o/ec-mulopt
Benchmark                                                                  Time             CPU      Time Old      Time New       CPU Old       CPU New
-------------------------------------------------------------------------------------------------------------------------------------------------------
precompile<PrecompileId::ecrecover, evmmax_cpp>_mean                    -0.2961         -0.2960        312197        219765        312126        219741
precompile<PrecompileId::ecmul, evmmax_cpp>_mean                        -0.3179         -0.3180        144903         98842        144882         98814
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

precompiles Related to EVM precompiles

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants