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

Improve batching in boltdb index #6044

Merged
merged 2 commits into from
Apr 29, 2022
Merged

Improve batching in boltdb index #6044

merged 2 commits into from
Apr 29, 2022

Conversation

cyriltovena
Copy link
Contributor

This removes the timer and sync code, and replace it with a batch cursor that iterate when required.

Also improve the memory usage.

❯ benchstat before.txt after.txt 
name       old time/op    new time/op    delta
_Query-16    3.16µs ± 4%    1.01µs ± 5%  -67.96%  (p=0.008 n=5+5)

name       old alloc/op   new alloc/op   delta
_Query-16    1.08kB ± 1%    0.66kB ± 0%  -38.95%  (p=0.008 n=5+5)

name       old allocs/op  new allocs/op  delta
_Query-16      15.0 ± 0%      10.0 ± 0%  -33.33%  (p=0.008 n=5+5)

Copy link
Contributor

@sandeepsukhani sandeepsukhani left a comment

Choose a reason for hiding this comment

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

Nice one! Just added a minor non blocking suggestion.

pkg/storage/chunk/client/local/boltdb_index_client.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants