-
Notifications
You must be signed in to change notification settings - Fork 602
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
x/incentives: Lower Epoch allocation overhead #7100
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:backport/v20.x
backport patches to v20.x branch
A:backport/v21.x
backport patches to v21.x branch
labels
Dec 12, 2023
ValarDragon
requested review from
mattverse,
p0mvn and
AlpinYukseloglu
as code owners
December 12, 2023 18:54
p0mvn
approved these changes
Dec 12, 2023
mergify bot
pushed a commit
that referenced
this pull request
Dec 12, 2023
* Lower allocation overhead * Add changelog (cherry picked from commit 63d2551) # Conflicts: # CHANGELOG.md
mergify bot
pushed a commit
that referenced
this pull request
Dec 12, 2023
* Lower allocation overhead * Add changelog (cherry picked from commit 63d2551)
ValarDragon
added a commit
that referenced
this pull request
Dec 12, 2023
* Lower allocation overhead * Add changelog (cherry picked from commit 63d2551) Co-authored-by: Dev Ojha <[email protected]>
ValarDragon
added a commit
that referenced
this pull request
Dec 13, 2023
* x/incentives: Lower Epoch allocation overhead (#7100) * Lower allocation overhead * Add changelog (cherry picked from commit 63d2551) # Conflicts: # CHANGELOG.md * Fix changelog conflict * Revert "Fix changelog conflict" This reverts commit 6235a69. * Fix Changelog.md * try Alessandro's fix --------- Co-authored-by: Dev Ojha <[email protected]> Co-authored-by: Dev Ojha <[email protected]>
ValarDragon
added a commit
that referenced
this pull request
Dec 20, 2023
* Lower allocation overhead * Add changelog (cherry picked from commit 63d2551) Co-authored-by: Dev Ojha <[email protected]>
ValarDragon
added a commit
that referenced
this pull request
Dec 21, 2023
* Lower allocation overhead * Add changelog (cherry picked from commit 63d2551) Co-authored-by: Dev Ojha <[email protected]>
Closed
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A:backport/v20.x
backport patches to v20.x branch
A:backport/v21.x
backport patches to v21.x branch
C:x/incentives
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.
The IAVL v2 benchmarks were showing Memory allocation as a significant chunk of the CPU time. (NOTE: CacheKV and DB overheads that are mainly applying to us in production are not shown in these benchmarks)
So looking at golang code, the capacity of a large slice grows by a factor of
1.25
every grow. So in the case where this is full / near full (most of the time), this would grow 3 or 4 times.1.25**3 = 1.95
, which involves expensive memcopies on top of extra allocations.Hence this speeds up the relevant logic.
From the IAVL v2 benchmarks, this is ~30% of the CPU time of the Distribute function!