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

Optimize Adding Dirty Indices #13660

Merged
merged 3 commits into from
Feb 24, 2024
Merged

Optimize Adding Dirty Indices #13660

merged 3 commits into from
Feb 24, 2024

Conversation

nisdas
Copy link
Member

@nisdas nisdas commented Feb 23, 2024

What type of PR is this?

Optimization

What does this PR do? Why is it needed?

We optimize how we add dirty indices for a particular field. In the event we do hit our indices limit, we attempt to remove duplicates before determining whether or not to rebuild the trie. This helps in prevent us from unnecessarily rebuilding a whole field trie.

Which issues(s) does this PR fix?

N.A

Other notes for review

@nisdas nisdas added the Ready For Review A pull request ready for code review label Feb 23, 2024
@nisdas nisdas requested a review from a team as a code owner February 23, 2024 11:09
@nisdas nisdas enabled auto-merge February 23, 2024 11:09
if totalIndicesLen > indicesLimit {
b.dirtyIndices[index] = slice.SetUint64(b.dirtyIndices[index])
}
totalIndicesLen = len(b.dirtyIndices[index]) + len(indices)
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to recompute this if the above if wasn't hit, so please move this up within the if branch

@nisdas nisdas added this pull request to the merge queue Feb 24, 2024
Merged via the queue into develop with commit 1d5a09c Feb 24, 2024
17 checks passed
@nisdas nisdas deleted the optDirtyIndices branch February 24, 2024 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants