1
0
mirror of https://github.com/golang/go synced 2024-09-30 20:28:32 -06:00
go/internal
Ian Cottrell eff45d17df internal/telemetry: convert key from string to struct
This makes keys a pointer, which reduces the allocations during logging, and has
a significant improvement in memory and cpu cost when there is no exporter.
Packing a string into an interface requires a 16 byte allocation, packing a pointer
does not.

name                old time/op    new time/op    delta
/LogNoExporter-8      4.39µs ± 2%    3.83µs ± 2%  -12.74%  (p=0.000 n=18+20)
/Log-8                23.5µs ± 2%    22.6µs ± 1%   -4.20%  (p=0.000 n=19+18)

name                old alloc/op   new alloc/op   delta
/LogNoExporter-8      1.70kB ± 0%    1.38kB ± 0%  -18.78%  (p=0.000 n=20+20)
/Log-8                4.91kB ± 0%    4.91kB ± 0%     ~     (p=1.000 n=20+20)

name                old allocs/op  new allocs/op  delta
/LogNoExporter-8        83.0 ± 0%      63.0 ± 0%  -24.10%  (p=0.000 n=20+20)
/Log-8                   163 ± 0%       163 ± 0%     ~     (all equal)

Change-Id: Iec127f1bff8d5c8f4bd0a6d9f6d8fc4b8bc740b2
Reviewed-on: https://go-review.googlesource.com/c/tools/+/222599
Run-TryBot: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2020-03-12 04:17:52 +00:00
..
apidiff all: fix more typos 2019-09-11 15:13:14 +00:00
fastwalk internal/fastwalk: fix checkptr failure on Darwin 2020-02-27 19:33:42 +00:00
gocommand internal/gocommand: kill gracefully 2020-02-25 21:33:51 +00:00
gopathwalk internal: rationalize debug logging 2020-03-03 16:59:18 +00:00
imports internal/imports: don't set a logger unless the user has provided it 2020-03-03 21:46:25 +00:00
jsonrpc2 internal/lsp/lsprpc: clean up client session on disconnection 2020-02-24 23:23:05 +00:00
lsp internal/telemetry: convert key from string to struct 2020-03-12 04:17:52 +00:00
memoize internal/lsp/debug: serve cache entry counts 2020-02-03 22:21:18 +00:00
packagesinternal internal/lsp: add module versions from "go list" to pkg.go.dev links 2020-02-19 19:55:21 +00:00
span internal/span: handle URI escaping better 2020-02-18 20:59:02 +00:00
telemetry internal/telemetry: convert key from string to struct 2020-03-12 04:17:52 +00:00
testenv internal/testenv: reject the resolved 'go' command if it does not match runtime.GOROOT 2019-11-11 19:22:22 +00:00
tool internal/tool: avoid editorialization 2020-03-05 14:01:59 +00:00
xcontext internal/lsp: stop making background contexts everywhere 2019-07-11 16:38:52 +00:00