pathBuilder improvements

- allocate starts slice with >0 capacity to minimize allocations

- increase initial buffer allocation size to 64

Signed-off-by: kim (grufwub) <grufwub@gmail.com>
development
kim (grufwub) 3 years ago
parent e4187eb229
commit d6df45cd41

@ -174,8 +174,8 @@ type pathBuilder struct {
// newPathBuilder returns a new pathBuilder
func newPathBuilder() *pathBuilder {
return &pathBuilder{
b: make([]byte, 32)[:0],
starts: []int{},
b: make([]byte, 64)[:0],
starts: make([]int, 10)[:0],
}
}

Loading…
Cancel
Save