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 performance of labels comparison when querying store-gateways #6348

Merged
merged 2 commits into from
Oct 12, 2023

Conversation

charleskorn
Copy link
Contributor

@charleskorn charleskorn commented Oct 12, 2023

What this PR does

This PR applies #5836 to two additional places that could benefit from it.

This improves performance when using stringlabels (as Mimir does). Note that the existing benchmark includes iterating through all of the samples in the series, which is why there isn't a dramatic latency change in the results below:

goos: darwin
goarch: arm64
pkg: github.com/grafana/mimir/pkg/querier
                                    │ before.txt  │             after.txt             │
                                    │   sec/op    │   sec/op     vs base              │
_blockQuerierSeriesSet_iteration-10   812.2m ± 0%   814.8m ± 0%  +0.32% (p=0.009 n=6)

                                    │  before.txt  │             after.txt              │
                                    │     B/op     │     B/op      vs base              │
_blockQuerierSeriesSet_iteration-10   8.426Mi ± 0%   7.694Mi ± 0%  -8.69% (p=0.002 n=6)

                                    │ before.txt  │             after.txt             │
                                    │  allocs/op  │  allocs/op   vs base              │
_blockQuerierSeriesSet_iteration-10   256.0k ± 0%   240.0k ± 0%  -6.25% (p=0.002 n=6)

Which issue(s) this PR fixes or relates to

(none)

Checklist

  • [n/a] Tests updated
  • [n/a] Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@charleskorn charleskorn marked this pull request as ready for review October 12, 2023 06:22
@charleskorn charleskorn requested a review from a team as a code owner October 12, 2023 06:22
@pracucci pracucci self-requested a review October 12, 2023 07:42
Copy link
Collaborator

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

Brilliant, thanks!

@pracucci pracucci merged commit dec2784 into main Oct 12, 2023
28 checks passed
@pracucci pracucci deleted the charleskorn/label-comparison-performance branch October 12, 2023 08:43
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.

2 participants