cppalliance / decimal

A C++14 implementation of IEEE 754 decimal floating point numbers
https://cppalliance.org/decimal/decimal.html
Boost Software License 1.0
21 stars 2 forks source link

Make dec32_fast even faster #620

Closed mborland closed 4 months ago

mborland commented 4 months ago

@ckormanyos Prior to this PR the benchmarks were showing that decimal32_fast was running in 0.686 of the time that decimal32 was. Now it's down to 0.251.

Closes: #619

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.1%. Comparing base (d49f31b) to head (89d1470).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/cppalliance/decimal/pull/620/graphs/tree.svg?width=650&height=150&src=pr&token=drvY8nnV5S&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance)](https://app.codecov.io/gh/cppalliance/decimal/pull/620?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance) ```diff @@ Coverage Diff @@ ## develop #620 +/- ## ========================================= - Coverage 99.1% 99.1% -0.0% ========================================= Files 214 214 Lines 14856 14794 -62 Branches 1629 1619 -10 ========================================= - Hits 14718 14653 -65 - Misses 138 141 +3 ``` | [Files](https://app.codecov.io/gh/cppalliance/decimal/pull/620?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance) | Coverage Δ | | |---|---|---| | [include/boost/decimal/decimal32\_fast.hpp](https://app.codecov.io/gh/cppalliance/decimal/pull/620?src=pr&el=tree&filepath=include%2Fboost%2Fdecimal%2Fdecimal32_fast.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance#diff-aW5jbHVkZS9ib29zdC9kZWNpbWFsL2RlY2ltYWwzMl9mYXN0LmhwcA==) | `97.4% <100.0%> (-0.9%)` | :arrow_down: | | [include/boost/decimal/detail/add\_impl.hpp](https://app.codecov.io/gh/cppalliance/decimal/pull/620?src=pr&el=tree&filepath=include%2Fboost%2Fdecimal%2Fdetail%2Fadd_impl.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance#diff-aW5jbHVkZS9ib29zdC9kZWNpbWFsL2RldGFpbC9hZGRfaW1wbC5ocHA=) | `100.0% <ø> (ø)` | | | [include/boost/decimal/detail/div\_impl.hpp](https://app.codecov.io/gh/cppalliance/decimal/pull/620?src=pr&el=tree&filepath=include%2Fboost%2Fdecimal%2Fdetail%2Fdiv_impl.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance#diff-aW5jbHVkZS9ib29zdC9kZWNpbWFsL2RldGFpbC9kaXZfaW1wbC5ocHA=) | `100.0% <ø> (ø)` | | | [include/boost/decimal/detail/mul\_impl.hpp](https://app.codecov.io/gh/cppalliance/decimal/pull/620?src=pr&el=tree&filepath=include%2Fboost%2Fdecimal%2Fdetail%2Fmul_impl.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance#diff-aW5jbHVkZS9ib29zdC9kZWNpbWFsL2RldGFpbC9tdWxfaW1wbC5ocHA=) | `100.0% <100.0%> (ø)` | | | [include/boost/decimal/detail/normalize.hpp](https://app.codecov.io/gh/cppalliance/decimal/pull/620?src=pr&el=tree&filepath=include%2Fboost%2Fdecimal%2Fdetail%2Fnormalize.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance#diff-aW5jbHVkZS9ib29zdC9kZWNpbWFsL2RldGFpbC9ub3JtYWxpemUuaHBw) | `100.0% <100.0%> (ø)` | | | [include/boost/decimal/detail/power\_tables.hpp](https://app.codecov.io/gh/cppalliance/decimal/pull/620?src=pr&el=tree&filepath=include%2Fboost%2Fdecimal%2Fdetail%2Fpower_tables.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance#diff-aW5jbHVkZS9ib29zdC9kZWNpbWFsL2RldGFpbC9wb3dlcl90YWJsZXMuaHBw) | `100.0% <ø> (ø)` | | | [include/boost/decimal/detail/sub\_impl.hpp](https://app.codecov.io/gh/cppalliance/decimal/pull/620?src=pr&el=tree&filepath=include%2Fboost%2Fdecimal%2Fdetail%2Fsub_impl.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance#diff-aW5jbHVkZS9ib29zdC9kZWNpbWFsL2RldGFpbC9zdWJfaW1wbC5ocHA=) | `98.3% <ø> (-1.7%)` | :arrow_down: | | [test/test\_decimal32\_fast\_basis.cpp](https://app.codecov.io/gh/cppalliance/decimal/pull/620?src=pr&el=tree&filepath=test%2Ftest_decimal32_fast_basis.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance#diff-dGVzdC90ZXN0X2RlY2ltYWwzMl9mYXN0X2Jhc2lzLmNwcA==) | `100.0% <100.0%> (ø)` | | | [test/test\_decimal\_quantum.cpp](https://app.codecov.io/gh/cppalliance/decimal/pull/620?src=pr&el=tree&filepath=test%2Ftest_decimal_quantum.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance#diff-dGVzdC90ZXN0X2RlY2ltYWxfcXVhbnR1bS5jcHA=) | `100.0% <ø> (ø)` | | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/cppalliance/decimal/pull/620/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance) ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/cppalliance/decimal/pull/620?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/cppalliance/decimal/pull/620?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance). Last update [d49f31b...89d1470](https://app.codecov.io/gh/cppalliance/decimal/pull/620?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance).