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

Reduce code duplication in 32 bit types #858

Merged
merged 22 commits into from
Feb 17, 2025
Merged

Reduce code duplication in 32 bit types #858

merged 22 commits into from
Feb 17, 2025

Conversation

mborland
Copy link
Member

Adds a method for one shot decoding and completely removes the subtraction implementation as we can just use a - b = a + (-b)

@mborland
Copy link
Member Author

Uses techniques from #857 to speed things way up.

Current develop:

===== Addition =====
Addition<decimal32  >: 1762595    us (s=999967341040)
Addition<dec32_fast >: 889756     us (s=999967341040)

===== Subtraction =====
Subtraction<decimal32  >: 1490533    us (s=166646259125)
Subtraction<dec32_fast >: 897638     us (s=166646259125)

with this PR:

===== Addition =====
Addition<decimal32  >: 613029     us (s=999967341040)
Addition<dec32_fast >: 628661     us (s=999967341040)

===== Subtraction =====
Subtraction<decimal32  >: 780128     us (s=166646259125)
Subtraction<dec32_fast >: 682079     us (s=166646259125)

Copy link

codecov bot commented Feb 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.9%. Comparing base (da32132) to head (19f9e2f).
Report is 29 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop    #858     +/-   ##
=========================================
+ Coverage     98.8%   98.9%   +0.1%     
=========================================
  Files          232     233      +1     
  Lines        16827   16824      -3     
  Branches      1813    1817      +4     
=========================================
  Hits         16625   16625             
+ Misses         202     199      -3     
Files with missing lines Coverage Δ
include/boost/decimal/decimal32.hpp 98.6% <100.0%> (+0.1%) ⬆️
include/boost/decimal/decimal32_fast.hpp 96.5% <100.0%> (+0.4%) ⬆️
include/boost/decimal/detail/add_impl.hpp 100.0% <100.0%> (ø)
include/boost/decimal/detail/cmath/fma.hpp 100.0% <100.0%> (ø)
include/boost/decimal/detail/components.hpp 100.0% <100.0%> (ø)
include/boost/decimal/detail/fenv_rounding.hpp 100.0% <ø> (ø)
include/boost/decimal/detail/sub_impl.hpp 95.5% <ø> (-1.5%) ⬇️
test/random_decimal32_fast_comp.cpp 100.0% <ø> (ø)

... and 4 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update da32132...19f9e2f. Read the comment docs.

@mborland mborland merged commit 7b4fa43 into develop Feb 17, 2025
75 checks passed
@mborland mborland deleted the better_decode branch February 17, 2025 21:41
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