-
Notifications
You must be signed in to change notification settings - Fork 607
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
BigDec operation speedups #8006
Conversation
WalkthroughThe update in version Changes
Recent Review DetailsConfiguration used: CodeRabbit UI Files ignored due to path filters (10)
Files selected for processing (4)
Files not reviewed due to errors (1)
Files skipped from review as they are similar to previous changes (1)
Additional comments not posted (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Important Notice This PR modifies an in-repo Go module. It is one of:
The dependent Go modules, especially the root one, will have to be Please follow the instructions below:
Please let us know if you need any help. |
I'll edit several CL methods in a second PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the go.mod at the highest level needs to be updated to use this version of osmomath in order to ensure all tests pass, and not just the osmomath specific tests (it LGTM, but would make sense to do this prior to merge)
if d.i.BitLen() > maxDecBitLen { | ||
panic("Int overflow") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this logic gets reused 5/6 times in this PR, maybe could be a single line helper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets do that in a second PR, agreed tho
…ependencies locally
* Rename precisionReuse and use squaredPrecisionReuse properly * Remove redundant copies for chop operations * Speedup RoundUpMut failed, just committing benchmark * CL notes * Speedup Truncate routines by saving ~2 word sizes * Add BigDec x Dec fns * Minor approx root spedup * Driveby, better mut usage in stableswap * Add AbsMut * Auto: update go.mod after push to dev/bigdec_speedups that modified dependencies locally --------- Co-authored-by: github-actions <[email protected]> (cherry picked from commit b56059e) # Conflicts: # CHANGELOG.md # go.mod # go.sum # osmomath/go.mod # osmomath/go.sum # osmoutils/go.mod # osmoutils/go.sum # x/epochs/go.mod # x/epochs/go.sum # x/ibc-hooks/go.mod # x/ibc-hooks/go.sum
* Rename precisionReuse and use squaredPrecisionReuse properly * Remove redundant copies for chop operations * Speedup RoundUpMut failed, just committing benchmark * CL notes * Speedup Truncate routines by saving ~2 word sizes * Add BigDec x Dec fns * Minor approx root spedup * Driveby, better mut usage in stableswap * Add AbsMut * Auto: update go.mod after push to dev/bigdec_speedups that modified dependencies locally --------- Co-authored-by: github-actions <[email protected]> (cherry picked from commit b56059e) # Conflicts: # go.mod # go.sum # osmomath/go.mod # osmomath/go.sum # osmoutils/go.mod # osmoutils/go.sum # x/epochs/go.mod # x/epochs/go.sum # x/ibc-hooks/go.mod # x/ibc-hooks/go.sum
* Rename precisionReuse and use squaredPrecisionReuse properly * Remove redundant copies for chop operations * Speedup RoundUpMut failed, just committing benchmark * CL notes * Speedup Truncate routines by saving ~2 word sizes * Add BigDec x Dec fns * Minor approx root spedup * Driveby, better mut usage in stableswap * Add AbsMut * Auto: update go.mod after push to dev/bigdec_speedups that modified dependencies locally --------- Co-authored-by: github-actions <[email protected]> (cherry picked from commit b56059e) # Conflicts: # go.mod # go.sum # osmomath/go.mod # osmomath/go.sum # osmoutils/go.mod # osmoutils/go.sum # x/epochs/go.mod # x/epochs/go.sum # x/ibc-hooks/go.mod # x/ibc-hooks/go.sum
* BigDec operation speedups (backport #8006) * Speedup quo round up, start CL speedup integration (#8014) * Speedup quo round up * Code reuse * Missed a code re-use point * Add future notes * Comment cleanup * Auto: update go.mod after push to dev/speedup_quoroundup that modified dependencies locally * Add new fn: NewBigDecFromDecMulDec * Auto: update go.mod after push to dev/speedup_quoroundup that modified dependencies locally * Remove some extra ops from CL * Further perf notes * Make faster QuoRoundUpNextIntMut * Auto: update go.mod after push to dev/speedup_quoroundup that modified dependencies locally * Remove another 2 BigDec ops * Add another dec op * Auto: update go.mod after push to dev/speedup_quoroundup that modified dependencies locally * Start moving some liquidity calls to Dec not BigDec * One more BigDec x Dec op * Auto: update go.mod after push to dev/speedup_quoroundup that modified dependencies locally * Another liq BigDec -> Dec * Missed one step * Move another Liquidity BigDec -> Dec * Minor spread reward update * Make CalcAmount1Dec use Dec for Liquidity * Make one more op mutative * One more speedup * Fix test * Speedup SpotPrice impl --------- Co-authored-by: github-actions <[email protected]> * updates * updates --------- Co-authored-by: Dev Ojha <[email protected]> Co-authored-by: github-actions <[email protected]>
Changes:
Its easiest to review this PR commit by commit