Skip to content

Commit d5076cc

Browse files
committed
gopls/internal/lsp/cache: don't trace a region for MetadataForFile
In the common case, MetadataForFile is just a map lookup. Benchmarks demonstrate that capturing a trace region is too expensive. Change-Id: I02d2b65de88f5db37beb16fba034e3c49c5f6096 Reviewed-on: https://go-review.googlesource.com/c/tools/+/481785 TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Alan Donovan <[email protected]> Run-TryBot: Robert Findley <[email protected]> gopls-CI: kokoro <[email protected]>
1 parent f796361 commit d5076cc

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

gopls/internal/lsp/cache/snapshot.go

-3
Original file line numberDiff line numberDiff line change
@@ -740,9 +740,6 @@ func (s *snapshot) MethodSets(ctx context.Context, ids ...PackageID) ([]*methods
740740
}
741741

742742
func (s *snapshot) MetadataForFile(ctx context.Context, uri span.URI) ([]*source.Metadata, error) {
743-
ctx, done := event.Start(ctx, "cache.snapshot.MetadataForFile")
744-
defer done()
745-
746743
s.mu.Lock()
747744

748745
// Start with the set of package associations derived from the last load.

0 commit comments

Comments
 (0)