-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Store: dont rely on slice labels continued #7099
Conversation
c938b6b
to
20de183
Compare
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😎😎😎
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for merging! 🙇
There was a problem hiding this 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 <[email protected]>
20de183
to
2f861d8
Compare
} | ||
} | ||
b := labels.NewBuilder(lset) | ||
extend.Range(func(l labels.Label) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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