Skip to content
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

Closed
wants to merge 4 commits into from

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Dec 16, 2022

This is an automatic backport of pull request #13881 done by Mergify.
Cherry-pick of cbee1b3 has failed:

On branch mergify/bp/release/v0.46.x/pr-13881
Your branch is up to date with 'origin/release/v0.46.x'.

You are currently cherry-picking commit cbee1b3ea.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   store/cachekv/benchmark_test.go
	new file:   store/cachekv/internal/btree.go
	new file:   store/cachekv/internal/btree_test.go
	new file:   store/cachekv/internal/memiterator.go
	renamed:    store/cachekv/mergeiterator.go -> store/cachekv/internal/mergeiterator.go
	deleted:    store/cachekv/memiterator.go
	modified:   store/cachekv/search_benchmark_test.go

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	both modified:   CHANGELOG.md
	both modified:   go.mod
	both modified:   go.sum
	deleted by us:   simapp/go.mod
	deleted by us:   simapp/go.sum
	both modified:   store/cachekv/store.go
	both modified:   store/cachekv/store_test.go
	deleted by us:   tests/go.mod
	deleted by us:   tests/go.sum

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> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

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
@mergify mergify bot requested a review from a team as a code owner December 16, 2022 05:05
@mergify mergify bot added the conflicts label Dec 16, 2022
@tac0turtle
Copy link
Member

We need to do some testing with this change. I can test on umee

Comment on lines 104 to 111
<<<<<<< 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))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<<<<<<< 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
}

Copy link
Collaborator

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

@tac0turtle
Copy link
Member

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

@tac0turtle tac0turtle closed this Dec 16, 2022
@mergify mergify bot deleted the mergify/bp/release/v0.46.x/pr-13881 branch December 16, 2022 13:38
@yihuang
Copy link
Collaborator

yihuang commented Dec 17, 2022

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.

@yihuang
Copy link
Collaborator

yihuang commented Dec 17, 2022

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

I think 0.46 is using 1.18 already?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants