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

fix(storage): Assume sorted StringIterators, and retain sorted order #13491

Merged
merged 3 commits into from
Apr 19, 2019

Conversation

jacobmarble
Copy link
Contributor

Assume that StringIterator always returns values in order, then retain that order on merge. Cost is log(n) per call to MergedStringIterator.Next() where n is the quantity of non-empty StringIterators.

Closes #13440

@jacobmarble jacobmarble self-assigned this Apr 17, 2019
@jacobmarble jacobmarble requested a review from zeebo April 18, 2019 22:53
Copy link
Contributor

@stuartcarnie stuartcarnie left a comment

Choose a reason for hiding this comment

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

Looks good, @jacobmarble

Only change I'd recommend is switching to an embedded struct vs a pointer for stringIteratorHeap

@jacobmarble jacobmarble merged commit 662cf57 into master Apr 19, 2019
@jacobmarble jacobmarble deleted the jgm-merged-sorted branch April 19, 2019 08:22
OfTheDelmer pushed a commit that referenced this pull request Apr 19, 2019
…13491)

* fix(storage): Assume sorted StringIterators, and retain sorted order

* embed struct field

* improve MergedStringIterator efficiency
stuartcarnie pushed a commit that referenced this pull request Apr 22, 2019
…13491)

* fix(storage): Assume sorted StringIterators, and retain sorted order

* embed struct field

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

Successfully merging this pull request may close these issues.

MergedStringIterator should assume sorted input, output
3 participants