-
Notifications
You must be signed in to change notification settings - Fork 591
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: avoid copy of period locks in epoch #7192
Conversation
x/incentives/keeper/iterator.go
Outdated
for _, lock := range locks { | ||
if lock.Duration >= minDuration { | ||
filteredLocks = append(filteredLocks, lock) | ||
filteredLocks = append(filteredLocks, &lock) |
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.
Does this work? I thought this would have every filtered lock point to the same loop variable, not the copies in the original slice. (Which would be &locks[i])
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.
It synched through epoch but I applied the suggestion and rerunning pprof
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.
Looks like my suggstion doesnt work by go tests failing
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.
Force pushed an update that I think should work. Need to reprofile it now as it leads to having to take a copy of the pointer in another loop
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.
3bd5551
to
de1c27c
Compare
Synching over many blocks. Will merge once ready |
* Reduce discrepancy in fee simulation * Update * State compatible applyFuncIfNoError event reduction * Update osmoutils/epochs versions * Update SDK version * One more epoch speedup * Speedup core loop of epoch * fix test (#7197) * refactor: auto-set timeout-commit to 4s for faster block times (#7196) * updates (#7192) * refactor: auto-set timeout-commit to 4s for faster block times (backport #7180) * changelog * Revert "updates (#7192)" This reverts commit 6cc26f9. * lint * Update changelog * Update changelog * changelog * Speedup multiplication * Try scratch slice * refactor: arb filter for new authz exec swap (#7210) * refactor: arb filter for new authz exec swap * updates * updates * updates * clean up * Auto: update go.mod after push to adam/v21.1.x-merge-to-main that modified dependencies locally * add 21.1.5 to changelog * update comment --------- Co-authored-by: Dev Ojha <dojha@berkeley.edu> Co-authored-by: Roman <roman@osmosis.team> Co-authored-by: github-actions <github-actions@github.com>
* Reduce discrepancy in fee simulation * Update * State compatible applyFuncIfNoError event reduction * Update osmoutils/epochs versions * Update SDK version * One more epoch speedup * Speedup core loop of epoch * fix test (#7197) * refactor: auto-set timeout-commit to 4s for faster block times (#7196) * updates (#7192) * refactor: auto-set timeout-commit to 4s for faster block times (backport #7180) * changelog * Revert "updates (#7192)" This reverts commit 6cc26f9. * lint * Update changelog * Update changelog * changelog * Speedup multiplication * Try scratch slice * refactor: arb filter for new authz exec swap (#7210) * refactor: arb filter for new authz exec swap * updates * updates * updates * clean up * Auto: update go.mod after push to adam/v21.1.x-merge-to-main that modified dependencies locally * add 21.1.5 to changelog * update comment --------- Co-authored-by: Dev Ojha <dojha@berkeley.edu> Co-authored-by: Roman <roman@osmosis.team> Co-authored-by: github-actions <github-actions@github.com> (cherry picked from commit c5a5147) # Conflicts: # go.mod # go.sum # osmomath/go.sum
* chore: catch up main to v21.1.x (#7215) * Reduce discrepancy in fee simulation * Update * State compatible applyFuncIfNoError event reduction * Update osmoutils/epochs versions * Update SDK version * One more epoch speedup * Speedup core loop of epoch * fix test (#7197) * refactor: auto-set timeout-commit to 4s for faster block times (#7196) * updates (#7192) * refactor: auto-set timeout-commit to 4s for faster block times (backport #7180) * changelog * Revert "updates (#7192)" This reverts commit 6cc26f9. * lint * Update changelog * Update changelog * changelog * Speedup multiplication * Try scratch slice * refactor: arb filter for new authz exec swap (#7210) * refactor: arb filter for new authz exec swap * updates * updates * updates * clean up * Auto: update go.mod after push to adam/v21.1.x-merge-to-main that modified dependencies locally * add 21.1.5 to changelog * update comment --------- Co-authored-by: Dev Ojha <dojha@berkeley.edu> Co-authored-by: Roman <roman@osmosis.team> Co-authored-by: github-actions <github-actions@github.com> (cherry picked from commit c5a5147) # Conflicts: # go.mod # go.sum # osmomath/go.sum * go mod update * update go mods from v21.x --------- Co-authored-by: Adam Tucker <adam@osmosis.team> Co-authored-by: Adam Tucker <adamleetucker@outlook.com>
Closes: #XXX
What is the purpose of the change
This speeds up epoch by avoiding copying stemming from period locks
New:
Old:
Testing and Verifying
Synched over epoch + 150 blocks.
Documentation and Release Note
Unreleased
section ofCHANGELOG.md
?Where is the change documented?
x/{module}/README.md
)