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: use overflowing_add for UnsignedInteger::add #521

Merged
merged 3 commits into from
Aug 16, 2023
Merged

Conversation

Oppen
Copy link
Member

@Oppen Oppen commented Aug 7, 2023

This allows using only u64 variables and gives a bit more information
to the compiler about our intent.

Results on M1 with 16GB:

add 1M elements | lambdaworks
                        time:   [7.0109 ms 7.0278 ms 7.0465 ms]
                        change: [-29.850% -29.645% -29.430%] (p = 0.00 < 0.01)
                        Performance has improved.

Checklist

  • This change is an Optimization
    • Benchmarks added/run

This allows using only `u64` variables and gives a bit more information
to the compiler about our intent.

Results on M1 with 16GB:
```
add 1M elements | lambdaworks
                        time:   [7.0109 ms 7.0278 ms 7.0465 ms]
                        change: [-29.850% -29.645% -29.430%] (p = 0.00 < 0.01)
                        Performance has improved.
```
@Oppen Oppen requested review from schouhy, ajgara and a team as code owners August 7, 2023 19:12
Copy link
Contributor

@schouhy schouhy left a comment

Choose a reason for hiding this comment

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

awesome!

@codecov-commenter
Copy link

Codecov Report

Merging #521 (4b190a2) into main (4c73e85) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #521   +/-   ##
=======================================
  Coverage   94.52%   94.52%           
=======================================
  Files          62       62           
  Lines        8963     8964    +1     
=======================================
+ Hits         8472     8473    +1     
  Misses        491      491           
Files Changed Coverage Δ
math/src/unsigned_integer/element.rs 98.27% <100.00%> (+<0.01%) ⬆️

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

@Oppen Oppen added this pull request to the merge queue Aug 16, 2023
Merged via the queue into main with commit 4b61d6f Aug 16, 2023
6 of 7 checks passed
@Oppen Oppen deleted the perf/overflowing_add branch August 16, 2023 20:17
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.

5 participants