]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: reduce allocations when building pprof LabelSet
authorMartin Möhrmann <moehrmann@google.com>
Mon, 10 Jun 2019 10:56:59 +0000 (12:56 +0200)
committerMartin Möhrmann <moehrmann@google.com>
Wed, 28 Aug 2019 10:43:11 +0000 (10:43 +0000)
commit5fb74fc13853b950b5102ef26d665db97f4838fd
tree6ccf7838b033762e05656f8a4bf8b264b452f783
parent37373592afe200a13d6ecf02b73a97e51beef9e1
runtime: reduce allocations when building pprof LabelSet

Pre-allocate the slice of labels with enough capacity
to avoid growslice calls.

Change-Id: I89db59ac722c03b0202e042d1f707bb041e0999f
Reviewed-on: https://go-review.googlesource.com/c/go/+/181517
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
src/runtime/pprof/label.go