go/internal/lsp/fuzzy
Rob Findley 15eebf7e82 internal/lsp: update the fuzzy matcher to operate on chunks
We can avoid allocating strings when performing workspace symbol search
by having the fuzzy match operate directly on chunks.

When operating on a single string, this slows down the matcher slightly
(perhaps 10%) due to copying bytes rather than accessing the string
directly. We could work around this using unsafe, but this could also be
mitigated by generics.

Benchmark ("test" in x/tools): 48ms->46ms
Benchmark ("test" in kubernetes): 868ms->857ms

Change-Id: Icf0f15aaa5cc3c875cf157a7b90db801045d9ed4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/338694
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2021-08-09 20:21:00 +00:00
..
input.go internal/lsp: update the fuzzy matcher to operate on chunks 2021-08-09 20:21:00 +00:00
input_test.go internal/lsp: update the fuzzy matcher to operate on chunks 2021-08-09 20:21:00 +00:00
matcher.go internal/lsp: update the fuzzy matcher to operate on chunks 2021-08-09 20:21:00 +00:00
matcher_test.go internal/lsp/fuzzy: fix return value on no match 2020-08-28 15:37:48 +00:00