mirror of https://github.com/tailscale/tailscale/
logtail: avoid bytes.Buffer allocation
Re-use a pre-allocated bytes.Buffer struct and shallow the copy the result of bytes.NewBuffer into it to avoid allocating the struct. Note that we're only reusing the bytes.Buffer struct itself and not the underling []byte temporarily stored within it. Updates #cleanup Updates tailscale/corp#18514 Updates golang/go#67004 Signed-off-by: Joe Tsai <joetsai@digital-static.net>dsnet/logtail-buffer2
parent
dd48cad89a
commit
fe73052985
Loading…
Reference in New Issue