go/internal/lsp/lsppos
Alan Donovan e92a18fd15 internal/lsp/lsppos: reduce allocations in NewMapper
Before, NewMapper accounts for 2.1% of bytes allocated in the
WorkspaceSymbols benchmark.  This change causes the newline index
table to be allocated once instead of by appending.
The function now accounts for 0.55%.

Change-Id: I9172dd34ee2be9e7175e311d4a6518f1e6660a5f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/415501
Auto-Submit: Alan Donovan <adonovan@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2022-07-01 16:40:13 +00:00
..
lsppos.go internal/lsp/lsppos: reduce allocations in NewMapper 2022-07-01 16:40:13 +00:00
lsppos_test.go internal/lsp/lsppos: add helpers for mapping token positions 2022-05-09 17:02:03 +00:00
token.go internal/lsp: factor out go/token wrapper into a safetoken package 2022-05-09 17:03:37 +00:00
token_test.go internal/lsp/lsppos: add helpers for mapping token positions 2022-05-09 17:02:03 +00:00