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

[WIP] optimize multiexp #6

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

[WIP] optimize multiexp #6

wants to merge 11 commits into from

Conversation

ashWhiteHat
Copy link
Owner

@ashWhiteHat ashWhiteHat commented May 31, 2022

Bench

small multiexp

k default refactor
3 762.74 us 767.22 us 772.03 us 700.75 us 706.56 us 712.23 us
4 1.5165 ms 1.5292 ms 1.5433 ms 1.4628 ms 1.4867 ms 1.5123 ms
5 3.0646 ms 3.0830 ms 3.1013 ms 2.8248 ms 2.8396 ms 2.8542 ms
6 6.0977 ms 6.1337 ms 6.1692 ms 5.8213 ms 5.8930 ms 5.9685 ms
7 12.201 ms 12.262 ms 12.323 ms 11.277 ms 11.334 ms 11.390 ms
8 24.472 ms 24.615 ms 24.759 ms 22.544 ms 22.676 ms 22.807 ms
9 48.897 ms 49.137 ms 49.379 ms 45.252 ms 45.470 ms 45.692 ms

best multiexp

k default refactor
3 934.38 us 934.93 us 935.68 us 722.91 us 723.05 us 723.18 us
4 1.8804 ms 1.8805 ms 1.8806 ms 1.5403 ms 1.5412 ms 1.5420 ms
5 3.6371 ms 3.6375 ms 3.6379 ms 2.7476 ms 2.7484 ms 2.7491 ms
6 7.3454 ms 7.3459 ms 7.3467 ms 5.5525 ms 5.5536 ms 5.5547 ms
7 15.855 ms 15.856 ms 15.857 ms 12.789 ms 12.790 ms 12.792 ms
8 28.904 ms 28.906 ms 28.908 ms 24.540 ms 24.542 ms 24.543 ms
9 57.763 ms 57.770 ms 57.779 ms 44.853 ms 44.866 ms 44.877 ms

@ashWhiteHat
Copy link
Owner Author

precompute 2^c and remove rev().

@ashWhiteHat
Copy link
Owner Author

arithmetic-small_multiexp/k/3
time: [662.08 us 667.76 us 673.66 us]
change: [-18.706% -13.588% -8.9632%] (p = 0.00 < 0.05)
Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) low mild
1 (1.00%) high mild
arithmetic-small_multiexp/k/4
time: [1.3247 ms 1.3433 ms 1.3622 ms]
change: [-15.633% -11.118% -6.9358%] (p = 0.00 < 0.05)
Performance has improved.
Found 1 outliers among 30 measurements (3.33%)
1 (3.33%) high mild
arithmetic-small_multiexp/k/5
time: [2.7566 ms 2.8504 ms 2.9586 ms]
change: [+7.6999% +10.925% +14.086%] (p = 0.00 < 0.05)
Performance has regressed.
arithmetic-small_multiexp/k/6
time: [5.2549 ms 5.3263 ms 5.4050 ms]
change: [+2.0148% +3.3540% +4.7522%] (p = 0.00 < 0.05)
Performance has regressed.
Found 3 outliers among 30 measurements (10.00%)
1 (3.33%) low mild
2 (6.67%) high mild
Benchmarking arithmetic-small_multiexp/k/7: Warming up for 3.0000 s
Warning: Unable to complete 30 samples in 5.0s. You may wish to increase target time to 5.3s, enable flat sampling, or reduce sample count to 20.
arithmetic-small_multiexp/k/7
time: [12.849 ms 13.634 ms 14.414 ms]
change: [+19.577% +26.444% +32.974%] (p = 0.00 < 0.05)
Performance has regressed.
arithmetic-small_multiexp/k/8
time: [21.939 ms 22.274 ms 22.598 ms]
change: [-39.226% -30.016% -20.567%] (p = 0.00 < 0.05)
Performance has improved.
Found 6 outliers among 30 measurements (20.00%)
1 (3.33%) low severe
1 (3.33%) low mild
4 (13.33%) high mild
arithmetic-small_multiexp/k/9
time: [49.899 ms 52.266 ms 54.902 ms]
change: [-16.183% -7.7273% +1.0345%] (p = 0.22 > 0.05)
No change in performance detected.
Found 1 outliers among 30 measurements (3.33%)
1 (3.33%) high mild
arithmetic-small_multiexp/k/10
time: [90.273 ms 93.986 ms 98.194 ms]
change: [-7.2842% -2.9722% +1.9544%] (p = 0.28 > 0.05)
No change in performance detected.
Found 5 outliers among 30 measurements (16.67%)
5 (16.67%) high mild
Benchmarking arithmetic-small_multiexp/k/11: Warming up for 3.0000 s
Warning: Unable to complete 30 samples in 5.0s. You may wish to increase target time to 5.4s, or reduce sample count to 20.
arithmetic-small_multiexp/k/11
time: [181.92 ms 185.59 ms 189.46 ms]
Benchmarking arithmetic-small_multiexp/k/12: Warming up for 3.0000 s
Warning: Unable to complete 30 samples in 5.0s. You may wish to increase target time to 10.7s, or reduce sample count to 10.
arithmetic-small_multiexp/k/12
time: [372.75 ms 383.60 ms 396.25 ms]
Found 1 outliers among 30 measurements (3.33%)
1 (3.33%) high severe
Benchmarking arithmetic-small_multiexp/k/13: Warming up for 3.0000 s
Warning: Unable to complete 30 samples in 5.0s. You may wish to increase target time to 21.6s, or reduce sample count to 10.
arithmetic-small_multiexp/k/13
time: [750.31 ms 792.94 ms 842.80 ms]
Found 5 outliers among 30 measurements (16.67%)
1 (3.33%) high mild
4 (13.33%) high severe
Benchmarking arithmetic-small_multiexp/k/14: Warming up for 3.0000 s
Warning: Unable to complete 30 samples in 5.0s. You may wish to increase target time to 44.3s, or reduce sample count to 10.
arithmetic-small_multiexp/k/14
time: [1.4363 s 1.4894 s 1.5463 s]
Benchmarking arithmetic-small_multiexp/k/15: Warming up for 3.0000 s
Warning: Unable to complete 30 samples in 5.0s. You may wish to increase target time to 82.9s, or reduce sample count to 10.
arithmetic-small_multiexp/k/15
time: [2.9722 s 3.0646 s 3.1597 s]

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.

1 participant