tools/internal
Robert Findley c35476fcce gopls: commands to start/stop profiling, and a new benchmark metric
Total CPU used by gopls is a critical metric for our users, yet was not
previously captured in any benchmark. This change uses the new pprof
parsing utilities added in CL 507885 to instrument a cpu_seconds
benchmark metric, for now just associated with the DidChange benchmark.

This is achieved via new LSP commands that start and stop a profile. The
benchmark runner uses these commands to bracket the critical section of
the benchmark, then parses the resulting profile for its total sampled
CPU.

Additionally, the benchmark runner is updated to actually check for the
existence of the custom command before instrumenting the new metric.
This allows it to be compatible with testing older versions of gopls.
The same technique is adopted for memstats metrics.

I only instrumented BenchmarkDidChange, because the profile file schema
is getting truly out of hand. I'll try to simplify it before
instrumenting all the other benchmarks, but want to do that in a
separate CL.

For golang/go#60926

Change-Id: Ia082bad49e8d30c567a7c07e050511d49b93738b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/508449
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-07-11 13:57:10 +00:00
..
analysisinternal go/analysis/passes/tests: enable fuzz checks in 'tests' analysis pass for cmd/vet 2023-03-30 21:38:09 +00:00
apidiff all: gofmt 2022-04-12 17:53:17 +00:00
bisect cmd/bisect, internal/bisect: use more precise skip suffixes, written in hex 2023-05-11 03:57:30 +00:00
cmd/deadcode internal/cmd/deadcode: a command to report dead code in Go programs 2023-07-10 18:10:37 +00:00
diff internal/diff: fix LineEdits bug in slow path 2023-06-01 18:40:17 +00:00
diffp internal/diffp: add patience diff from main repo 2023-05-05 00:46:00 +00:00
event gopls/internal/lsp/cache: reduce importing in analysis 2023-06-20 19:04:06 +00:00
facts gopls/internal/lsp/cache: reduce importing in analysis 2023-06-20 19:04:06 +00:00
fakenet internal/fakenet: add a fake network connection 2020-05-27 14:27:59 +00:00
fastwalk internal/fastwalk: doc formatting fixes (including godoc links) 2023-06-28 16:11:18 +00:00
fuzzy internal/fuzzy: improvements to the symbol scoring algorithm 2023-05-09 14:15:48 +00:00
gcimporter gopls/internal/lsp/cache: reduce importing in analysis 2023-06-20 19:04:06 +00:00
gocommand gopls: additional instrumentation during goimports 2023-05-10 16:50:45 +00:00
gopathwalk internal/gopathwalk: use os.ReadFile instead of ioutil.ReadFile 2023-07-10 20:18:28 +00:00
goroot internal/gcimporter: load cached export data for packages individually 2022-12-02 18:23:46 +00:00
imports gopls/internal/regtest: fix goimports on windows when using vendoring 2023-06-15 14:21:39 +00:00
jsonrpc2 all: fix non-gopls short tests on js/wasm and update for wasip1/wasm 2023-04-20 14:27:21 +00:00
jsonrpc2_v2 internal: fix typo 2023-07-10 15:00:08 +00:00
memoize internal/memoize: fix race in Store.Promise 2022-07-28 15:35:11 +00:00
packagesinternal x/tools/go/packages: on Go 1.19+, explicitly ask for -json fields needed 2022-04-19 17:08:06 +00:00
persistent gopls/internal/lsp/cache: invalidate metadata after vendor change 2022-12-02 15:45:07 +00:00
pkgbits all: fix some comments 2023-01-31 16:03:41 +00:00
pprof internal/pprof: a function to compute total pprof time 2023-07-06 20:34:16 +00:00
proxydir all: remove version-specific test files 2020-05-28 17:13:50 +00:00
robustio internal/robustio: fix signature of getFileID on plan9 2023-02-01 18:41:57 +00:00
stack all: gofmt 2022-04-12 17:53:17 +00:00
testenv gopls: skip tests that load gopls packages if x/tools replacement is missing 2023-05-02 16:53:13 +00:00
tokeninternal gopls/internal/lsp/cache: hold on to imports used by open packages 2023-03-24 15:12:23 +00:00
tool gopls: commands to start/stop profiling, and a new benchmark metric 2023-07-11 13:57:10 +00:00
typeparams internal/typeparams: work around LookupFieldOrMethod inconsistency 2023-06-06 20:18:50 +00:00
typesinternal internal/typesinternal: remove NewObjectpathFunc 2023-05-22 13:02:24 +00:00
xcontext internal/lsp: stop making background contexts everywhere 2019-07-11 16:38:52 +00:00