-
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: optimize iteration on nested cache context (backport #13881) #14337
Conversation
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: Marko <marbar3778@yahoo.com> Closes #10310 (cherry picked from commit cbee1b3) # Conflicts: # CHANGELOG.md # go.mod # go.sum # simapp/go.mod # simapp/go.sum # store/cachekv/store.go # store/cachekv/store_test.go # tests/go.mod # tests/go.sum
We need to do some testing with this change. I can test on umee |
store/cachekv/store.go
Outdated
<<<<<<< HEAD | ||
======= | ||
if len(store.cache) == 0 && len(store.deleted) == 0 && len(store.unsortedCache) == 0 { | ||
store.sortedCache = internal.NewBTree() | ||
return | ||
} | ||
|
||
>>>>>>> cbee1b3ea (perf: optimize iteration on nested cache context (#13881)) |
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.
<<<<<<< HEAD | |
======= | |
if len(store.cache) == 0 && len(store.deleted) == 0 && len(store.unsortedCache) == 0 { | |
store.sortedCache = internal.NewBTree() | |
return | |
} | |
>>>>>>> cbee1b3ea (perf: optimize iteration on nested cache context (#13881)) | |
if len(store.cache) == 0 && len(store.deleted) == 0 && len(store.unsortedCache) == 0 { | |
store.sortedCache = internal.NewBTree() | |
return | |
} | |
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.
this part is added by #12494
unfortunately this backport requires go 1.18 which is a change we cant force on users in a minor release. We would need to fork tidal or revert to google/btree. @yihuang do you have a preference |
The reason to use tidal is it provides the Iter() api, which can be used to implement iterator without using a go-routine, the google version only supports visit with callbacks. |
I think 0.46 is using 1.18 already? |
This is an automatic backport of pull request #13881 done by Mergify.
Cherry-pick of cbee1b3 has failed:
To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally
Mergify commands and options
More conditions and actions can be found in the documentation.
You can also trigger Mergify actions by commenting on this pull request:
@Mergifyio refresh
will re-evaluate the rules@Mergifyio rebase
will rebase this PR on its base branch@Mergifyio update
will merge the base branch into this PR@Mergifyio backport <destination>
will backport this PR on<destination>
branchAdditionally, on Mergify dashboard you can:
Finally, you can contact us on https://mergify.com