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: bump starknet-crypto version #1011

Merged
merged 1 commit into from
Apr 19, 2023
Merged

perf: bump starknet-crypto version #1011

merged 1 commit into from
Apr 19, 2023

Conversation

Oppen
Copy link
Member

@Oppen Oppen commented Apr 19, 2023

The new release includes an optimization for the ECDSA signature verification that makes it take 85% less time.
We're missing automated benchmarks for this case, but manually modifying cairo_programs/common_signature.cairo to run 1000 times I measured the new version to be 8.5x faster than main with Hyperfine.

Checklist

  • Linked to Github Issue
  • Unit tests added
  • Integration tests added.
  • This change requires new documentation.
    • Documentation has been added/updated.
    • CHANGELOG has been updated.

@github-actions
Copy link

github-actions bot commented Apr 19, 2023

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 3.551 ± 0.065 3.487 3.653 1.00 ± 0.02
head blake2s_integration_benchmark 3.549 ± 0.059 3.479 3.667 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 4.292 ± 0.040 4.227 4.354 1.03 ± 0.01
head compare_arrays_200000 4.177 ± 0.034 4.147 4.239 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 3.227 ± 0.059 3.184 3.382 1.01 ± 0.04
head dict_integration_benchmark 3.180 ± 0.094 3.065 3.398 1.00
Command Mean [s] Min [s] Max [s] Relative
base factorial_multirun 5.108 ± 0.072 4.955 5.238 1.02 ± 0.03
head factorial_multirun 5.007 ± 0.109 4.901 5.233 1.00
Command Mean [s] Min [s] Max [s] Relative
base fibonacci_1000_multirun 3.969 ± 0.054 3.890 4.054 1.00
head fibonacci_1000_multirun 4.183 ± 0.160 3.929 4.402 1.05 ± 0.04
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 4.238 ± 0.140 4.020 4.459 1.00
head integration_builtins 4.276 ± 0.101 4.184 4.511 1.01 ± 0.04
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 3.851 ± 0.065 3.716 3.942 1.01 ± 0.02
head keccak_integration_benchmark 3.820 ± 0.067 3.742 3.917 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 4.283 ± 0.073 4.145 4.372 1.00
head linear_search 4.394 ± 0.094 4.264 4.554 1.03 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 3.606 ± 0.059 3.519 3.721 1.01 ± 0.02
head math_cmp_and_pow_integration_benchmark 3.563 ± 0.060 3.457 3.628 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 3.295 ± 0.041 3.234 3.380 1.00 ± 0.02
head math_integration_benchmark 3.285 ± 0.032 3.226 3.334 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 2.972 ± 0.032 2.933 3.026 1.00
head memory_integration_benchmark 2.981 ± 0.035 2.933 3.056 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 2.807 ± 0.054 2.747 2.888 1.02 ± 0.03
head operations_with_data_structures_benchmarks 2.757 ± 0.049 2.697 2.861 1.00
Command Mean [s] Min [s] Max [s] Relative
base pedersen 4.112 ± 0.052 4.058 4.209 1.00 ± 0.02
head pedersen 4.092 ± 0.061 4.004 4.179 1.00
Command Mean [s] Min [s] Max [s] Relative
base poseidon_integration_benchmark 1.807 ± 0.030 1.731 1.841 1.00 ± 0.02
head poseidon_integration_benchmark 1.800 ± 0.026 1.758 1.831 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 3.209 ± 0.029 3.172 3.251 1.00
head secp_integration_benchmark 3.246 ± 0.034 3.199 3.301 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base set_integration_benchmark 2.543 ± 0.033 2.509 2.613 1.00 ± 0.02
head set_integration_benchmark 2.537 ± 0.041 2.481 2.611 1.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.651 ± 0.074 4.555 4.797 1.00
head uint256_integration_benchmark 4.703 ± 0.114 4.561 4.936 1.01 ± 0.03

The new release includes an optimization for the ECDSA signature
verification that makes it take 85% less time.
@Oppen Oppen marked this pull request as ready for review April 19, 2023 05:04
@codecov
Copy link

codecov bot commented Apr 19, 2023

Codecov Report

Merging #1011 (633ee50) into main (d545372) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1011   +/-   ##
=======================================
  Coverage   98.02%   98.02%           
=======================================
  Files          76       76           
  Lines       31643    31643           
=======================================
  Hits        31019    31019           
  Misses        624      624           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@fmoletta fmoletta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 🥳

Copy link
Contributor

@MegaRedHand MegaRedHand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 👏 👏

@Oppen Oppen added this pull request to the merge queue Apr 19, 2023
Merged via the queue into main with commit fe781fd Apr 19, 2023
16 checks passed
@Oppen Oppen deleted the update_starknet-crypto branch April 19, 2023 15:12
kariy pushed a commit to dojoengine/cairo-rs that referenced this pull request Jun 23, 2023
The new release includes an optimization for the ECDSA signature
verification that makes it take 85% less time.
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.

None yet

3 participants