You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are experiencing very slow task execution with NX because of the project graph creation takes a very long time (1m 30s). To be more precise this happens when there is 1 file change when you run the task, if you run more tasks without changing anything in between the create-project-graph-async is relatively fast (5s).
We did some debugging and found out that almost all time is consumed in the plugin 'nx/js/dependencies-and-lockfile'. No matter how many files are changed, this plugin goes over all projects and all imports which takes a lot of time.
Example output of a lint task with perf logging on and daemon switch off. We added some extra logging to output changed files and what is processed.
Example output of the same linting task but with a file change. Once you have a file change the time for 'build typescript dependencies' increases to 1m15s and this time is spend in the buildExplicitTypeScriptDependencies 'nx/js/dependencies-and-lockfile' (packages/nx/src/plugins/js/project-graph/build-dependencies/explicit-project-dependencies.ts)
For reference the extra debugging we added to the explicit-project-dependencies code
To debug this further is difficult as from here on its handed over to the rust code. It not clear to us why all projects and all imports are processed when one single file is changed. Because of the size of our monorepo, this processing takes a very long time. We have more than 4250 projects in our monorepo and millions of typescript files.
For debugging purpose we disabled the daemon, but we experience the same behavior with the daemon enabled. With the daemon the timings are more fluctuating from 30 seconds up to 4 minutes to create the project graph.
Expected Behavior
The expected behavior is that running nx commands is as fast as without nx. The overhead of creating the project graph and task graph should be ideally below 1s but because of size everything under 5s is reasonable. Above this it will be impacting developer experience as it feels delayed.
Current Behavior
We are experiencing very slow task execution with NX because of the project graph creation takes a very long time (1m 30s). To be more precise this happens when there is 1 file change when you run the task, if you run more tasks without changing anything in between the create-project-graph-async is relatively fast (5s).
We did some debugging and found out that almost all time is consumed in the plugin 'nx/js/dependencies-and-lockfile'. No matter how many files are changed, this plugin goes over all projects and all imports which takes a lot of time.
Example output of a lint task with perf logging on and daemon switch off. We added some extra logging to output changed files and what is processed.
Example output of the same linting task but with a file change. Once you have a file change the time for 'build typescript dependencies' increases to 1m15s and this time is spend in the buildExplicitTypeScriptDependencies 'nx/js/dependencies-and-lockfile' (packages/nx/src/plugins/js/project-graph/build-dependencies/explicit-project-dependencies.ts)
For reference the extra debugging we added to the explicit-project-dependencies code
To debug this further is difficult as from here on its handed over to the rust code. It not clear to us why all projects and all imports are processed when one single file is changed. Because of the size of our monorepo, this processing takes a very long time. We have more than 4250 projects in our monorepo and millions of typescript files.
For debugging purpose we disabled the daemon, but we experience the same behavior with the daemon enabled. With the daemon the timings are more fluctuating from 30 seconds up to 4 minutes to create the project graph.
Expected Behavior
The expected behavior is that running nx commands is as fast as without nx. The overhead of creating the project graph and task graph should be ideally below 1s but because of size everything under 5s is reasonable. Above this it will be impacting developer experience as it feels delayed.
GitHub Repo
No response
Steps to Reproduce
Nx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: