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: verified addresses for Pedersen as Vec<bool> #1029

Merged
merged 3 commits into from
Apr 22, 2023
Merged

Conversation

Oppen
Copy link
Contributor

@Oppen Oppen commented Apr 21, 2023

The use of a Vec<Relocatable> was the major bottleneck for that builtin.

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.

@Oppen Oppen marked this pull request as draft April 21, 2023 02:46
@Oppen Oppen marked this pull request as ready for review April 21, 2023 02:48
@github-actions
Copy link

github-actions bot commented Apr 21, 2023

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 3.598 ± 0.055 3.533 3.714 1.00
head blake2s_integration_benchmark 3.641 ± 0.150 3.432 3.956 1.01 ± 0.04
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 4.355 ± 0.135 4.150 4.591 1.00 ± 0.04
head compare_arrays_200000 4.350 ± 0.110 4.187 4.519 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 3.194 ± 0.071 3.106 3.299 1.00
head dict_integration_benchmark 3.249 ± 0.059 3.155 3.368 1.02 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base factorial_multirun 5.235 ± 0.049 5.168 5.311 1.01 ± 0.02
head factorial_multirun 5.207 ± 0.061 5.102 5.323 1.00
Command Mean [s] Min [s] Max [s] Relative
base fibonacci_1000_multirun 4.203 ± 0.073 4.118 4.334 1.00
head fibonacci_1000_multirun 4.317 ± 0.101 4.206 4.533 1.03 ± 0.03
Command Mean [ms] Min [ms] Max [ms] Relative
base field_arithmetic_get_square_benchmark 150.1 ± 31.4 133.6 238.0 1.05 ± 0.23
head field_arithmetic_get_square_benchmark 142.4 ± 7.2 133.7 154.2 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 4.384 ± 0.139 4.186 4.547 1.04 ± 0.04
head integration_builtins 4.235 ± 0.087 4.104 4.366 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 4.146 ± 0.089 4.024 4.247 1.03 ± 0.03
head keccak_integration_benchmark 4.027 ± 0.070 3.949 4.195 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 4.411 ± 0.062 4.368 4.574 1.00
head linear_search 4.430 ± 0.077 4.309 4.572 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 3.636 ± 0.066 3.545 3.777 1.00 ± 0.02
head math_cmp_and_pow_integration_benchmark 3.636 ± 0.053 3.583 3.766 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 3.281 ± 0.061 3.200 3.381 1.01 ± 0.02
head math_integration_benchmark 3.260 ± 0.039 3.196 3.315 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 2.921 ± 0.066 2.834 3.048 1.01 ± 0.03
head memory_integration_benchmark 2.905 ± 0.045 2.809 2.974 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 2.915 ± 0.078 2.820 3.055 1.01 ± 0.03
head operations_with_data_structures_benchmarks 2.899 ± 0.044 2.839 2.971 1.00
Command Mean [s] Min [s] Max [s] Relative
base pedersen 4.232 ± 0.056 4.176 4.366 4.35 ± 0.12
head pedersen 0.974 ± 0.024 0.944 1.009 1.00
Command Mean [s] Min [s] Max [s] Relative
base poseidon_integration_benchmark 1.780 ± 0.052 1.721 1.900 1.00
head poseidon_integration_benchmark 1.853 ± 0.078 1.727 1.972 1.04 ± 0.05
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 3.360 ± 0.109 3.250 3.535 1.01 ± 0.04
head secp_integration_benchmark 3.334 ± 0.080 3.226 3.495 1.00
Command Mean [s] Min [s] Max [s] Relative
base set_integration_benchmark 2.470 ± 0.053 2.390 2.537 1.02 ± 0.03
head set_integration_benchmark 2.431 ± 0.040 2.380 2.508 1.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.706 ± 0.094 4.610 4.860 1.00
head uint256_integration_benchmark 4.740 ± 0.118 4.457 4.887 1.01 ± 0.03

@codecov
Copy link

codecov bot commented Apr 21, 2023

Codecov Report

Merging #1029 (4f82799) into main (0155288) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1029   +/-   ##
=======================================
  Coverage   98.08%   98.08%           
=======================================
  Files          79       79           
  Lines       32694    32703    +9     
=======================================
+ Hits        32069    32078    +9     
  Misses        625      625           
Impacted Files Coverage Δ
src/vm/runners/builtin_runner/hash.rs 98.54% <100.00%> (+0.03%) ⬆️

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

The use of a `Vec<Relocatable>` was the major bottleneck for that
builtin.
@Oppen Oppen changed the title perf: verified addresses for Pedersen as BitVec perf: verified addresses for Pedersen as Vec<bool> Apr 21, 2023
Copy link
Collaborator

@juanbono juanbono left a comment

Choose a reason for hiding this comment

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

LGTM

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 enabled auto-merge April 21, 2023 21:18
@Oppen Oppen added this pull request to the merge queue Apr 21, 2023
@Oppen Oppen removed this pull request from the merge queue due to a manual request Apr 21, 2023
@Oppen Oppen added this pull request to the merge queue Apr 22, 2023
Merged via the queue into main with commit 31a05d9 Apr 22, 2023
@Oppen Oppen deleted the pedersen_opti branch April 22, 2023 04:33
kariy pushed a commit to dojoengine/cairo-rs that referenced this pull request Jun 23, 2023
The use of a `Vec<Relocatable>` was the major bottleneck for that
builtin.
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.

3 participants