Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): improve touched projects locator performance #16682

Merged
merged 1 commit into from
May 1, 2023

Conversation

FrozenPandaz
Copy link
Collaborator

Current Behavior

Detecting if a project was deleted requires running a git command to get the contents of a .json file which takes a long time.

Expected Behavior

Detecting if a project was deleted is as simple as checking if the config file is still present on disk.

This brings the time needed to filter affected projects for 22 changed project configs from:

- filter: 506.884ms
+ filter: 111.389ms

These numbers are from the nx repo on my machine.

Related Issue(s)

Fixes #

@vercel
Copy link

vercel bot commented May 1, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 1, 2023 7:54pm

const isProjectFile = minimatch(touchedFile.file, combinedGlobPattern);
if (isProjectFile) {
// If the file no longer exists on disk, then it was deleted
if (!existsSync(join(workspaceRoot, touchedFile.file))) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the new line

@github-actions
Copy link

github-actions bot commented May 7, 2023

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants