Closed
Description
I just noticed that in certain packages, diagnostics are very slow after adding or removing an import (or making any other metadata-affecting change).
It looks like I introduced an awaitLoaded(...)
call into the critical path re-typechecking a package (via resolveImportGraph
). When the package being edited is low level, this results in reloading its entire reverse-transitive closure.
As an invariant, we should always be able to operate on the current package without reloading everything.
- add a benchmark for this operation, which is common thanks to goimports on save
- fix the logic of
resolveImportGraph