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

optimize exp for even bases #189

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Valeh2012
Copy link

full benchstat:

goarch: amd64
pkg: github.com/holiman/uint256
cpu: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
                         │    old.txt     │               new.txt               │
                         │     sec/op     │   sec/op     vs base                │
Exp/large/big-2               21.01µ ± 8%   21.60µ ± 5%        ~ (p=0.393 n=10)
Exp/large/even/big-2          6.033µ ± 6%   6.133µ ± 6%        ~ (p=0.353 n=10)
Exp/large/uint256-2           2.311µ ± 4%   2.348µ ± 5%        ~ (p=0.315 n=10)
Exp/large/even/uint256-2   2279.500n ± 4%   6.894n ± 3%  -99.70% (p=0.000 n=10)
Exp/small/big-2               7.050µ ± 8%   6.753µ ± 3%        ~ (p=0.579 n=10)
Exp/small/even/big-2          1.979µ ± 6%   1.982µ ± 6%        ~ (p=0.684 n=10)
Exp/small/uint256-2           200.0n ± 4%   205.8n ± 5%        ~ (p=0.853 n=10)
Exp/small/even/uint256-2    206.300n ± 4%   7.024n ± 5%  -96.60% (p=0.000 n=10)
geomean                       2.104µ        671.8n       -68.07%

                         │    old.txt     │                new.txt                │
                         │      B/op      │     B/op      vs base                 │
Exp/large/big-2            17.72Ki ± 0%     17.72Ki ± 0%       ~ (p=1.000 n=10) ¹
Exp/large/even/big-2       1.391Ki ± 0%     1.391Ki ± 0%       ~ (p=1.000 n=10) ¹
Exp/large/uint256-2          0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
Exp/large/even/uint256-2     0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
Exp/small/big-2            7.219Ki ± 0%     7.219Ki ± 0%       ~ (p=1.000 n=10) ¹
Exp/small/even/big-2       1.203Ki ± 0%     1.203Ki ± 0%       ~ (p=1.000 n=10) ¹
Exp/small/uint256-2          0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
Exp/small/even/uint256-2     0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                 ²                 +0.00%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                         │   old.txt    │               new.txt               │
                         │  allocs/op   │ allocs/op   vs base                 │
Exp/large/big-2            189.0 ± 0%     189.0 ± 0%       ~ (p=1.000 n=10) ¹
Exp/large/even/big-2       15.00 ± 0%     15.00 ± 0%       ~ (p=1.000 n=10) ¹
Exp/large/uint256-2        0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
Exp/large/even/uint256-2   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
Exp/small/big-2            77.00 ± 0%     77.00 ± 0%       ~ (p=1.000 n=10) ¹
Exp/small/even/big-2       13.00 ± 0%     13.00 ± 0%       ~ (p=1.000 n=10) ¹
Exp/small/uint256-2        0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
Exp/small/even/uint256-2   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                               ²               +0.00%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

closes #188

Copy link

codecov bot commented Oct 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (555918b) to head (11b4a73).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #189   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines         1666      1675    +9     
=========================================
+ Hits          1666      1675    +9     

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.

optimize exp for even bases
1 participant