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

Optimizations for multiplication #199

Merged
merged 6 commits into from Mar 14, 2021
Merged

Optimizations for multiplication #199

merged 6 commits into from Mar 14, 2021

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Mar 14, 2021

Relevant benchmarks:

 factorial_100          5,137                 2,663                      -2,474  -48.16%   x 1.93
 factorial_div_biguint  791,253               773,134                   -18,119   -2.29%   x 1.02
 factorial_div_u32      766,341               748,398                   -17,943   -2.34%   x 1.02
 factorial_mul_biguint  113,269               58,480                    -54,789  -48.37%   x 1.94
 factorial_mul_u32      35,062                37,848                      2,786    7.95%   x 0.93
 multiply_0             39                    40                              1    2.56%   x 0.98
 multiply_1             3,693                 3,708                          15    0.41%   x 1.00
 multiply_2             309,911               215,371                   -94,540  -30.51%   x 1.44
 multiply_3             662,091               494,419                  -167,672  -25.32%   x 1.34
 pow_bench              2,550,050             2,144,069                -405,981  -15.92%   x 1.19
 pow_bench_1e1000       1,332                 1,071                        -261  -19.59%   x 1.24
 pow_bench_1e10000      62,234                36,109                    -26,125  -41.98%   x 1.72
 pow_bench_1e100000     2,530,757             1,134,613              -1,396,144  -55.17%   x 2.23
 pow_bench_bigexp       2,630,660             2,155,688                -474,972  -18.06%   x 1.22

@cuviper
Copy link
Member Author

cuviper commented Mar 14, 2021

bors r+

@bors
Copy link
Contributor

bors bot commented Mar 14, 2021

@bors bors bot merged commit 125fbbd into rust-num:master Mar 14, 2021
@renatoathaydes
Copy link

Hi! I've run a little benchmark comparing the performance of some code I have that uses BigUint using version 0.4.0 and then the master branch of this repo, which already has this fix...

Here's how much difference it makes:

Input Size and Runtime (ms)

As this was merged on the 14th of March, I assume it has not been released yet as the last release was on the 05th of March?

When will this be released, it really improves performance by a lot!

Thanks!

@cuviper
Copy link
Member Author

cuviper commented Aug 28, 2021

Thanks for the nudge -- I've now published 0.4.1!

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

2 participants