go/gopls/internal
Robert Findley d303668635 internal/lsp/cache: use cached parsed files for symbols, if available
Optimize building the symbol index for a file, in two ways:
 - use the cached full parse tree, if it already exists
 - if it doesn't exist, optimize parsing by skipping both comments and
   object resolution, which aren't necessary for symbols

This results in around 3x faster initial indexing of symbols. In my
manual testing, indexing of Kubernetes went from 16s->5s, and indexing
of x/tools went from 2.4s->700ms.

Also fix a typo in gopls/internal/regtest/bench/bench_test.go.

Fixes #52602

Change-Id: I0893e95410be96e94e5e9dee7a3aab30b59c19c5
Reviewed-on: https://go-review.googlesource.com/c/tools/+/403679
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2022-05-09 17:04:06 +00:00
..
coverage gopls/internal/coverage: apply gofmt to the build tag syntax 2021-04-08 20:55:59 +00:00
hooks gopls: upgrade staticcheck to v0.3.0 2022-04-07 14:59:24 +00:00
regtest internal/lsp/cache: use cached parsed files for symbols, if available 2022-05-09 17:04:06 +00:00
vulncheck gopls, internal/lsp: gofmt 2022-04-12 17:41:31 +00:00