-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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!: Add HasAccount to the AuthKeeper to save protobuf decoding time #10022
Conversation
We found in the Osmosis epoch time, the many accesses to GetAccount's proto unmarshalling was a significant slowdown. This adds a HasAccount method to the AuthKeeper, and fixes one unnecessary spot that it appears within in SendCoins
Codecov Report
@@ Coverage Diff @@
## master #10022 +/- ##
==========================================
- Coverage 63.56% 63.56% -0.01%
==========================================
Files 572 572
Lines 53581 53584 +3
==========================================
+ Hits 34058 34059 +1
- Misses 17580 17582 +2
Partials 1943 1943
|
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.
LGTM
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
Automerge seems like its failing due to unrelated cosmovisor error :( |
Visit https://dashboard.github.orijtech.com?back=0&pr=10022&remote=false&repo=cosmos%2Fcosmos-sdk to see benchmark details. |
@Mergifyio backport release/v0.45.x |
✅ Backports have been created
|
#10022) * Add HasAccount to the AuthKeeper to save protobuf decoding time We found in the Osmosis epoch time, the many accesses to GetAccount's proto unmarshalling was a significant slowdown. This adds a HasAccount method to the AuthKeeper, and fixes one unnecessary spot that it appears within in SendCoins * Update Spec * Add Changelog entry * Fix lint & use speedup in SendCoins * Update x/auth/keeper/account.go Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> (cherry picked from commit 7273bd3) # Conflicts: # CHANGELOG.md
…e (backport #10022) (#10847) * perf!: Add HasAccount to the AuthKeeper to save protobuf decoding time (#10022) * Add HasAccount to the AuthKeeper to save protobuf decoding time We found in the Osmosis epoch time, the many accesses to GetAccount's proto unmarshalling was a significant slowdown. This adds a HasAccount method to the AuthKeeper, and fixes one unnecessary spot that it appears within in SendCoins * Update Spec * Add Changelog entry * Fix lint & use speedup in SendCoins * Update x/auth/keeper/account.go Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> (cherry picked from commit 7273bd3) # Conflicts: # CHANGELOG.md * conflicts * changelog * changelog Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> Co-authored-by: Federico Kunze Küllmer <federico.kunze94@gmail.com>
…e (backport cosmos#10022) (cosmos#10847) * perf!: Add HasAccount to the AuthKeeper to save protobuf decoding time (cosmos#10022) * Add HasAccount to the AuthKeeper to save protobuf decoding time We found in the Osmosis epoch time, the many accesses to GetAccount's proto unmarshalling was a significant slowdown. This adds a HasAccount method to the AuthKeeper, and fixes one unnecessary spot that it appears within in SendCoins * Update Spec * Add Changelog entry * Fix lint & use speedup in SendCoins * Update x/auth/keeper/account.go Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> (cherry picked from commit 7273bd3) # Conflicts: # CHANGELOG.md * conflicts * changelog * changelog Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> Co-authored-by: Federico Kunze Küllmer <federico.kunze94@gmail.com>
…e (backport cosmos#10022) (cosmos#10847) * perf!: Add HasAccount to the AuthKeeper to save protobuf decoding time (cosmos#10022) * Add HasAccount to the AuthKeeper to save protobuf decoding time We found in the Osmosis epoch time, the many accesses to GetAccount's proto unmarshalling was a significant slowdown. This adds a HasAccount method to the AuthKeeper, and fixes one unnecessary spot that it appears within in SendCoins * Update Spec * Add Changelog entry * Fix lint & use speedup in SendCoins * Update x/auth/keeper/account.go Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> (cherry picked from commit 7273bd3) # Conflicts: # CHANGELOG.md * conflicts * changelog * changelog Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> Co-authored-by: Federico Kunze Küllmer <federico.kunze94@gmail.com>
Description
This PR adds a HasAccount method to the AuthKeeper, which lets you just check if an account exists, without unmarshalling it. This PR also fixes one unnecessary spot that it appears within in SendCoins.
This PR is API breaking (Adds HasAccount to the AuthKeeper) but is not state machine breaking.
We found in the Osmosis epoch time, the many accesses to GetAccount's proto unmarshalling was a significant slowdown. This PR has been benchmarked to improve that performance! (As it halves the amount of proto unmarshals in SendCoins. There is still one more remaining, a subsidiary call within LockedCoins(), within SubtractCoins)
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change