x/tools/gopls: recursive orphaned file reloading #59318
Labels
FrozenDueToAge
gopls/metadata
Issues related to metadata loading in gopls
gopls/performance
Issues related to gopls performance (CPU, memory, etc).
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
While investigating #59184, I found what I think may be a long-standing bug in gopls that potentially explains many user reports (such as #54007).
Therefore, if orphaned file reloading tries to load N files, it will call go/packages once with N file= queries, which invokes
go list
N times. The load will succeed, because it produces at least one package, but only one command-line-arguments package will be recorded. The next time orphaned file reloading occurs, it will retry with N-1 files.I.e. orphaned reloading involves N^2 go list invocations...
CC @adonovan
The text was updated successfully, but these errors were encountered: