-
Notifications
You must be signed in to change notification settings - Fork 601
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
De-duplicate fetching intermediate accounts #7411
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ValarDragon
added
V:state/compatible/backport
State machine compatible PR, should be backported
A:no-changelog
A:backport/v22.x
backport patches to v22.x branch
labels
Feb 5, 2024
ValarDragon
requested review from
mattverse and
AlpinYukseloglu
as code owners
February 5, 2024 18:12
ValarDragon
commented
Feb 5, 2024
@@ -799,7 +799,7 @@ func (k Keeper) Distribute(ctx sdk.Context, gauges []types.Gauge) (sdk.Coins, er | |||
|
|||
locksByDenomCache := make(map[string][]lockuptypes.PeriodLock) | |||
totalDistributedCoins := sdk.NewCoins() | |||
scratchSlice := make([]*lockuptypes.PeriodLock, 0, 10000) | |||
scratchSlice := make([]*lockuptypes.PeriodLock, 0, 50000) |
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.
Sorry, accidental drive by change, but should be benign as the scratch slice's need should be max_{gauges}(# accts gauge pays out to)
AlpinYukseloglu
approved these changes
Feb 5, 2024
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
mergify bot
pushed a commit
that referenced
this pull request
Feb 5, 2024
* De-duplicate fetching intermediate accounts * Fix build * De-duplicate BondDenom fetch (cherry picked from commit fda7971)
ValarDragon
added a commit
that referenced
this pull request
Feb 5, 2024
* De-duplicate fetching intermediate accounts * Fix build * De-duplicate BondDenom fetch (cherry picked from commit fda7971) Co-authored-by: Dev Ojha <[email protected]>
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A:backport/v22.x
backport patches to v22.x branch
A:no-changelog
C:x/incentives
C:x/superfluid
V:state/compatible/backport
State machine compatible PR, should be backported
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
State compatibly de-duplicate get intermediate account fetches. On its own, this isn't much of a savings (20ms with and w/o fast nodes -- not sure why theres cache hits in IAVL v1 and fast nodes off TBH). The hope is that this can be used with an additional filter to cheapen more expensive loops going on in both methods. The latter may not be state compatible, hence making two PR's.
This also removes getting the BondDenom from the core loop, saving another 60ms