Skip to content

Commit

Permalink
gopls/internal/lsp/cache: don't trace a region for MetadataForFile
Browse files Browse the repository at this point in the history
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 <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
  • Loading branch information
findleyr committed Apr 4, 2023
1 parent f796361 commit d5076cc
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions gopls/internal/lsp/cache/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -740,9 +740,6 @@ func (s *snapshot) MethodSets(ctx context.Context, ids ...PackageID) ([]*methods
}

func (s *snapshot) MetadataForFile(ctx context.Context, uri span.URI) ([]*source.Metadata, error) {
ctx, done := event.Start(ctx, "cache.snapshot.MetadataForFile")
defer done()

s.mu.Lock()

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

0 comments on commit d5076cc

Please sign in to comment.