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

evmmax: Make ModArith header-only and constexpr #964

Merged
merged 1 commit into from
Aug 7, 2024
Merged

Conversation

rodiazet
Copy link
Collaborator

@rodiazet rodiazet commented Jul 30, 2024

Move all ModArith's methods to the class definition and make them constexpr.

Change evmmax library type to INTERFACE.

@rodiazet rodiazet requested a review from chfast July 30, 2024 16:14
@rodiazet rodiazet force-pushed the evmmax-refactor branch 2 times, most recently from 5012562 to 9b18758 Compare July 30, 2024 16:28
Copy link

codecov bot commented Jul 30, 2024

Codecov Report

Attention: Patch coverage is 97.95918% with 1 line in your changes missing coverage. Please review.

Project coverage is 94.29%. Comparing base (391bd64) to head (81d067e).

Files Patch % Lines
test/unittests/evmmax_test.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #964      +/-   ##
==========================================
- Coverage   94.29%   94.29%   -0.01%     
==========================================
  Files         143      143              
  Lines       16128    16131       +3     
==========================================
+ Hits        15208    15210       +2     
- Misses        920      921       +1     
Flag Coverage Δ
eof_execution_spec_tests 16.64% <0.00%> (-0.23%) ⬇️
ethereum_tests 26.93% <97.95%> (+<0.01%) ⬆️
ethereum_tests_silkpre 18.69% <100.00%> (+<0.01%) ⬆️
execution_spec_tests 17.73% <0.00%> (-0.23%) ⬇️
unittests 89.72% <97.95%> (-0.01%) ⬇️

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

Files Coverage Δ
include/evmmax/evmmax.hpp 100.00% <100.00%> (ø)
lib/evmone_precompiles/bn254.cpp 100.00% <ø> (ø)
lib/evmone_precompiles/secp256k1.cpp 100.00% <ø> (ø)
test/unittests/evmmax_test.cpp 96.55% <0.00%> (-1.70%) ⬇️

@chfast chfast added the EVMMAX label Aug 6, 2024
@chfast chfast changed the title evmmax: Make ModArith possible to use as constexpr evmmax: Make ModArith header-only and constexpr Aug 6, 2024
@chfast
Copy link
Member

chfast commented Aug 7, 2024

These are the rough performance improvements:

precompile<PrecompileId::ecrecover, evmmax_cpp>_mean                       -0.0445         -0.0445        409414        391193        409365        391152
precompile<PrecompileId::ecadd, evmmax_cpp>_mean                           -0.0008         -0.0007          9156          9148          9153          9147
precompile<PrecompileId::ecmul, evmmax_cpp>_mean                           -0.0639         -0.0636        190056        177917        189981        177891

Move all ModArith's methods to the class definition and make them
constexpr.

Change evmmax library type to INTERFACE.

Co-authored-by: rodiazet <radek.zagorowicz@gmail.com>
@chfast chfast merged commit b2d0672 into master Aug 7, 2024
26 checks passed
@chfast chfast deleted the evmmax-refactor branch August 7, 2024 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants