mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 05:34:05 -08:00
labels: make InternStrings a no-op for stringlabels version
The current implementation of `InternStrings` will only save memory when the whole set of labels is identical to one already seen, and this cannot happen in the one place it is called from in Prometheus, remote-write, which already detects identical series. Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
parent
501bc6419e
commit
14b4fbc2ff
|
@ -450,14 +450,12 @@ func (ls Labels) DropMetricName() Labels {
|
||||||
return ls
|
return ls
|
||||||
}
|
}
|
||||||
|
|
||||||
// InternStrings calls intern on every string value inside ls, replacing them with what it returns.
|
// InternStrings is a no-op because it would only save when the whole set of labels is identical.
|
||||||
func (ls *Labels) InternStrings(intern func(string) string) {
|
func (ls *Labels) InternStrings(intern func(string) string) {
|
||||||
ls.data = intern(ls.data)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReleaseStrings calls release on every string value inside ls.
|
// ReleaseStrings is a no-op for the same reason as InternStrings.
|
||||||
func (ls Labels) ReleaseStrings(release func(string)) {
|
func (ls Labels) ReleaseStrings(release func(string)) {
|
||||||
release(ls.data)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Labels returns the labels from the builder.
|
// Labels returns the labels from the builder.
|
||||||
|
|
Loading…
Reference in a new issue