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(tableIterator): Don't do next on NewIterator #1512

Merged
merged 2 commits into from
Sep 15, 2020

Conversation

jarifibrahim
Copy link
Contributor

@jarifibrahim jarifibrahim commented Sep 8, 2020

We are doing an additional Next() in table.NewIterator. This PR removes the additional next call.

When a iterator is created, the usual flow is NewIterator => Rewind => continue .
In the current implementation we do a next() call in NewIterator and a seekToFirst in Rewind . Both the operations do the same thing and we can get rid of the next call in NewIterator


This change is Reviewable

@jarifibrahim jarifibrahim merged commit 74d24d8 into master Sep 15, 2020
@jarifibrahim jarifibrahim deleted the ibrahim/anand-query-test branch September 15, 2020 08:01
jarifibrahim pushed a commit that referenced this pull request Oct 2, 2020
We are doing an additional `Next()` in `table.NewIterator`. 
This PR removes the additional next call (which saves roughly 90ms)

When an iterator is created, the usual flow is `NewIterator` => `Rewind`.
In the current implementation, we do a next() call in
`NewIterator` and a `seekToFirst` in `Rewind`. Both the operations do
the same thing and we can get rid of the next call in `NewIterator`.
mYmNeo added a commit to mYmNeo/badger that referenced this pull request Jan 16, 2023
mYmNeo added a commit to mYmNeo/badger that referenced this pull request Feb 13, 2023
mYmNeo added a commit to mYmNeo/badger that referenced this pull request Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants