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

Benchmark for leap BLS Host Functions #1854

Closed
2 tasks done
bhazzard opened this issue Nov 2, 2023 · 2 comments · Fixed by #1884 or #1898
Closed
2 tasks done

Benchmark for leap BLS Host Functions #1854

bhazzard opened this issue Nov 2, 2023 · 2 comments · Fixed by #1884 or #1898
Assignees

Comments

@bhazzard
Copy link

bhazzard commented Nov 2, 2023

Tasks

Preview Give feedback
@bhazzard bhazzard added this to the Leap v5.0.0-rc3 milestone Nov 2, 2023
@bhazzard bhazzard removed the triage label Nov 2, 2023
@linh2931 linh2931 moved this from Todo to In Progress in Team Backlog Nov 6, 2023
@bhazzard bhazzard modified the milestones: Leap v5.0.0-rc3, Leap v5.0.0 Nov 7, 2023
@arhag arhag linked a pull request Nov 14, 2023 that will close this issue
@github-project-automation github-project-automation bot moved this from In Progress to Done in Team Backlog Nov 14, 2023
@BenjaminGormanPMP BenjaminGormanPMP moved this from Done to In Progress in Team Backlog Nov 14, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Todo in Team Backlog Nov 14, 2023
@linh2931 linh2931 moved this from Todo to In Progress in Team Backlog Nov 15, 2023
@linh2931
Copy link
Member

Implemented benchmarking to compare Jacobian and Affine forms.

Jacobian, on commit 9c42d4248e4dccae0f2edc6f9214a62794afa0f2

function                                runs        average       minimum       maximum

bls:
bls_g1_add                              5,000       3,750 ns       3,572 ns      12,580 ns
bls_g1_add_mont                         5,000       3,420 ns       3,253 ns      12,142 ns
bls_g2_add                              5,000      10,512 ns       9,811 ns      21,856 ns
bls_g2_add_mont                         5,000       9,707 ns       9,229 ns      21,503 ns
bls_pairing 1 pair                      5,000   1,789,295 ns   1,680,824 ns   7,485,899 ns
bls_pairing_mont 1 pair                 5,000   1,731,573 ns   1,684,301 ns   3,213,257 ns
bls_pairing 3 pairs                     5,000   2,724,449 ns   2,657,346 ns   4,076,564 ns
bls_pairing_mont 3 pairs                5,000   2,725,833 ns   2,655,432 ns   6,151,175 ns
bls_g1_weighted_sum 1 point             5,000     177,830 ns     175,772 ns     204,178 ns
bls_g1_weighted_sum_mont 1 point        5,000     183,024 ns     180,422 ns   1,554,149 ns
bls_g1_weighted_sum 3 points            5,000     615,286 ns     605,572 ns   1,985,376 ns
bls_g1_weighted_sum_mont 3 points       5,000     595,925 ns     586,211 ns   1,955,829 ns
bls_g1_weighted_sum 5 points            5,000     724,105 ns     714,152 ns   2,096,116 ns
bls_g1_weighted_sum_mont 5 points       5,000     728,274 ns     718,108 ns   2,090,126 ns
bls_g2_weighted_sum 1 point             5,000     735,463 ns     712,924 ns   2,095,999 ns
bls_g2_weighted_sum_mont 1 point        5,000     731,287 ns     708,690 ns   2,084,301 ns
bls_g2_weighted_sum 3 points            5,000   2,295,894 ns   2,237,104 ns   3,633,355 ns
bls_g2_weighted_sum_mont 3 points       5,000   2,238,961 ns   2,175,627 ns   3,472,883 ns
bls_g2_weighted_sum 5 points            5,000   2,829,470 ns   2,757,140 ns   4,180,830 ns
bls_g2_weighted_sum_mont 5 points       5,000   2,892,231 ns   2,812,751 ns   4,241,635 ns
bls_g1_map                              5,000     306,458 ns     301,740 ns   1,684,554 ns
bls_g1_map_mont                         5,000     303,953 ns     298,359 ns   1,673,634 ns
bls_g2_map                              5,000     454,003 ns     444,571 ns   1,820,435 ns
bls_g2_map_mont                         5,000     456,514 ns     445,941 ns   1,823,631 ns
bls_fp_mod                              5,000         781 ns         690 ns       8,787 ns
bls_fp_mod_mont                         5,000         764 ns         681 ns       7,016 ns
bls_fp_mul                              5,000         686 ns         640 ns       6,361 ns
bls_fp_mul_mont                         5,000         586 ns         542 ns       6,448 ns
bls_fp_exp                              5,000      32,425 ns      31,204 ns   1,416,640 ns
bls_fp_exp_mont                         5,000      31,837 ns      30,855 ns      41,987 ns

===========================================================

Affine, on commit 4e40590d6625573b5a6e00707b986b5714a9dee3

function                                runs        average       minimum       maximum

bls:
bls_g1_add                              5,000      77,719 ns      75,522 ns     123,998 ns
bls_g1_add_mont                         5,000      75,660 ns      74,316 ns     121,959 ns
bls_g2_add                              5,000      82,483 ns      81,150 ns     130,991 ns
bls_g2_add_mont                         5,000      83,391 ns      81,074 ns     131,948 ns
bls_pairing 1 pair                      5,000   1,614,102 ns   1,566,750 ns   2,160,096 ns
bls_pairing_mont 1 pair                 5,000   1,609,031 ns   1,565,495 ns   2,178,670 ns
bls_pairing 3 pairs                     5,000   2,323,198 ns   2,253,232 ns   3,124,991 ns
bls_pairing_mont 3 pairs                5,000   2,337,377 ns   2,257,550 ns   3,166,491 ns
bls_g1_weighted_sum 1 point             5,000     256,019 ns     253,462 ns     325,327 ns
bls_g1_weighted_sum_mont 1 point        5,000     261,760 ns     258,768 ns     330,475 ns
bls_g1_weighted_sum 3 points            5,000     678,693 ns     670,652 ns     827,537 ns
bls_g1_weighted_sum_mont 3 points       5,000     677,811 ns     669,599 ns     829,915 ns
bls_g1_weighted_sum 5 points            5,000     806,671 ns     797,678 ns     962,701 ns
bls_g1_weighted_sum_mont 5 points       5,000     815,045 ns     806,476 ns     968,147 ns
bls_g2_weighted_sum 1 point             5,000     794,808 ns     767,789 ns   1,176,624 ns
bls_g2_weighted_sum_mont 1 point        5,000     804,249 ns     775,860 ns   1,235,798 ns
bls_g2_weighted_sum 3 points            5,000   2,369,944 ns   2,309,946 ns   3,194,070 ns
bls_g2_weighted_sum_mont 3 points       5,000   2,365,119 ns   2,313,643 ns   3,198,058 ns
bls_g2_weighted_sum 5 points            5,000   2,868,338 ns   2,807,154 ns   3,823,564 ns
bls_g2_weighted_sum_mont 5 points       5,000   2,935,925 ns   2,870,823 ns   3,908,198 ns
bls_g1_map                              5,000     373,337 ns     368,418 ns     562,477 ns
bls_g1_map_mont                         5,000     376,647 ns     370,497 ns     561,968 ns
bls_g2_map                              5,000     533,549 ns     522,231 ns     725,724 ns
bls_g2_map_mont                         5,000     532,100 ns     523,396 ns     730,689 ns
bls_fp_mod                              5,000         777 ns         690 ns       5,269 ns
bls_fp_mod_mont                         5,000         764 ns         651 ns       5,357 ns
bls_fp_mul                              5,000         688 ns         614 ns       5,542 ns
bls_fp_mul_mont                         5,000         604 ns         544 ns       7,334 ns
bls_fp_exp                              5,000      31,778 ns      31,018 ns      40,560 ns
bls_fp_exp_mont                         5,000      31,548 ns      30,976 ns      42,508 ns

@arhag
Copy link
Member

arhag commented Nov 29, 2023

Benchmarking was completed and integrated into the yarkin/update_bls branch. This will be brought into the release/5.0 branch via PR #1882 which is associated to the issue #1701.

Since that final work to integrate these changes into release/5.0 is already tracked by #1701 and the benchmarking has been completed, I am closing this issue.

@arhag arhag closed this as completed Nov 29, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Team Backlog Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment