Skip to content

Conversation

@evanwporter
Copy link
Contributor

Small little performance optimizations

  • std::move within toString method. Move instead of copies result
  • Define DecimalFactor at compile time rather than run time

…ings at compile time rather than run time. This may have a small bump on performance, but either way it can't hurt.
… a small perfomance benefit since it will move the value rather than copy it. I only made these changes within the toString functions where I know the std::library is being used.
@evanwporter
Copy link
Contributor Author

Note that this may conflict with #54 (without a small adjustment to #54), but seeing as that has yet to be merged...

@evanwporter evanwporter changed the title Compile time DecimalFactor definitions & move semantics optimizations Performance Optimizations using std::move and constexpr Aug 22, 2024
@evanwporter
Copy link
Contributor Author

FYI: Copying becomes more computationally costly as the string gets longer.

@vpiotr
Copy link
Owner

vpiotr commented Aug 25, 2024

Looks OK, thanks!

@vpiotr vpiotr merged commit 695f5ea into vpiotr:master Aug 25, 2024
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.

2 participants