Opmize GetLabels and GetLabels values from store gateway
What this PR does: Right now, we wait the result from all store gateways be returned to only then Merge/Dedup the response.
This change is similar to what was done on: https://github.com/cortexproject/cortex/pull/5785
➜ ~ ~/go/bin/benchstat /tmp/old /tmp/new
goos: darwin
goarch: arm64
pkg: github.com/cortexproject/cortex/pkg/querier
│ /tmp/old │ /tmp/new │
│ sec/op │ sec/op vs base │
BlocksStoreQuerier_Labels-10 3.013m ± 1% 2.147m ± 0% -28.76% (p=0.002 n=6)
│ /tmp/old │ /tmp/new │
│ B/op │ B/op vs base │
BlocksStoreQuerier_Labels-10 8.832Mi ± 0% 2.151Mi ± 0% -75.64% (p=0.002 n=6)
│ /tmp/old │ /tmp/new │
│ allocs/op │ allocs/op vs base │
BlocksStoreQuerier_Labels-10 20.06k ± 0% 19.84k ± 0% -1.10% (p=0.002 n=6)
Which issue(s) this PR fixes:
Fixes #
Checklist
- [NA] Tests updated
- [NA ] Documentation added
- [NA]
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]
@alanprot Can we provide some kind of go benchmark results?
@yeya24 Update the PR to use the MergeSlicesParallel and added a bench.
It seems better but maybe we need more tests? like with different number of labels being returned?
This issue has been automatically marked as stale because it has not had any activity in the past 60 days. It will be closed in 15 days if no further activity occurs. Thank you for your contributions.