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

Store: dont rely on slice labels continued #7099

Conversation

MichaHoffmann
Copy link
Contributor

@MichaHoffmann MichaHoffmann commented Jan 27, 2024

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Converted some other slice label usages to be stringlabel compatible. I fear that performance will take a hit because we are not very economical with our labels.Builders here, but i'm happy if tests pass first of all.

Verification

Previous Tests still pass hopefully

@MichaHoffmann MichaHoffmann force-pushed the mhoffm-dont-use-slice-labels-continued branch from c938b6b to 20de183 Compare January 27, 2024 18:27
@@ -118,20 +118,19 @@ require (
require (
github.com/mitchellh/go-ps v1.0.0
github.com/onsi/gomega v1.27.10
github.com/prometheus-community/prom-label-proxy v0.7.0
github.com/prometheus-community/prom-label-proxy v0.8.1-0.20240127162815-c1195f9aabc0
Copy link
Member

Choose a reason for hiding this comment

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

😎😎😎

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for merging! 🙇

@MichaHoffmann MichaHoffmann marked this pull request as ready for review January 27, 2024 21:29
Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

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

Thanks!

Signed-off-by: Michael Hoffmann <mhoffm@posteo.de>
@MichaHoffmann MichaHoffmann force-pushed the mhoffm-dont-use-slice-labels-continued branch from 20de183 to 2f861d8 Compare January 29, 2024 08:16
}
}
b := labels.NewBuilder(lset)
extend.Range(func(l labels.Label) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this introduces a double for loop, but it might not be as bad in real world cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It benchmarks 3x worse for what we have, a solution is to pass in extend still as a slice but that would need way more refactoring.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is fine for now, we can optimize if it shows in a profile.

@MichaHoffmann MichaHoffmann merged commit 13e1558 into thanos-io:main Jan 29, 2024
20 checks passed
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.

4 participants