mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 22:19:40 -08:00
Merge pull request #12072 from bboreham/stringlabels-builder-size
labels-as-strings: size buffer for added labels
This commit is contained in:
commit
99b3961907
|
@ -599,7 +599,8 @@ func (b *Builder) Labels(res Labels) Labels {
|
|||
sort.Strings(b.del)
|
||||
a, d := 0, 0
|
||||
|
||||
buf := make([]byte, 0, len(b.base.data)) // TODO: see if we can re-use the buffer from res.
|
||||
bufSize := len(b.base.data) + labelsSize(b.add)
|
||||
buf := make([]byte, 0, bufSize) // TODO: see if we can re-use the buffer from res.
|
||||
for pos := 0; pos < len(b.base.data); {
|
||||
oldPos := pos
|
||||
var lName string
|
||||
|
|
Loading…
Reference in a new issue