Fix massive performance regression for projects using correct module graphs
The aim of this PR is to eventually resolve the massive performance problems ELS has, as reported by: https://github.com/ember-tooling/ember-language-server/issues/406
I'm starting with adding some logging, as I just need to figure out where time is being lost and why.
Debugger listening on ws://127.0.0.1:6003/c81ef594-cdb9-4d96-9894-0ff910200d8d
For help, see: https://nodejs.org/en/docs/inspector
[Info - 6:23:19 PM] lazy init enabled, waiting for config from VSCode
"Initializing Ember Language Server at <repo>"
[Info - 6:23:19 PM] ELS: executeInitializers
[Info - 6:23:19 PM] ELS: 1 initializers
[Info - 6:23:20 PM] ELS: Found 102 roots for <repo>
[Info - 6:23:20 PM] Initializing new project at <repo>/apps/client with 0 ELS addons.
[Info - 6:25:29 PM] Ember CLI project added at <repo>/apps/client. (took 128694ms)
😬
So far, it's looking like project.initialize is the problem
it looks like trying to find the "roots" takes the longest:
[Info - 12:39:34 PM] ELS: executeInitializers
[Info - 12:39:34 PM] ELS: 1 initializers
[Info - 12:39:35 PM] ELS: Found 102 roots for <repo>
[Info - 12:39:35 PM] Initializing new project at <repo>/apps/client with 0 ELS addons.
[Info - 12:39:35 PM] [collectProjectProviders] +0ms :: Starting : <repo>/apps/client
[Info - 12:41:50 PM] [collectProjectProviders] +135319ms :: found roots : <repo>/apps/client
[Info - 12:41:50 PM] [collectProjectProviders] +336ms :: found ELS addons : <repo>/apps/client
[Info - 12:41:50 PM] [collectProjectProviders] +0ms :: finished crawling dagMap : <repo>/apps/client
[Info - 12:41:50 PM] Ember CLI project added at <repo>/apps/client. (took 135656ms)
[Info - 12:44:06 PM] <repo>/apps/client: registry initialized in 136155ms
[Info - 12:44:06 PM] <repo>/apps/client: script registry initialized in 32ms
[Info - 12:44:07 PM] <app> registry version mismatch [-1, 0], regenerating...
[Info - 12:44:07 PM] <app> registry generated in 8ms, new version: 0
[Info - 12:44:07 PM] Initializing new project at <repo>/apps/documentation with 0 ELS addons.
[Info - 12:44:07 PM] [collectProjectProviders] +0ms :: Starting : <repo>/apps/documentation
[Info - 12:44:12 PM] [collectProjectProviders] +4718ms :: found roots : <repo>/apps/documentation
[Info - 12:44:12 PM] [collectProjectProviders] +66ms :: found ELS addons : <repo>/apps/documentation
[Info - 12:44:12 PM] [collectProjectProviders] +0ms :: finished crawling dagMap : <repo>/apps/documentation
I have a feeling we're not de-duping dependency crawling based on package.json{name,version}
TypeError: (0 , node_assert_1.default) is not a function
67 | `;
what is going on in this project 😅
locally: green!
oh wat, it's green. :thinking: