Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK with excluding both
node_modulesand.git.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! So to be clear, updating this argument
**/node_modules/**to{**/node_modules/**,.git/**}would be ideal?I'll test that out to make sure I have the right glob syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be interesting if there is some performance comparison data to share.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the 2nd argument appends rather than replaces. The existing command in this PR:
runs the following process:
The
-g '!**/.git'exclusion comes from VS Code's default settings.{ "files.exclude": { "**/.git": true, "**/.svn": true, "**/.hg": true, "**/CVS": true, "**/.DS_Store": true, "**/Thumbs.db": true } }https://github.com/microsoft/vscode/blob/2798da9d47387c0fb6ab4ebbead95efb5a85c250/src/vs/workbench/contrib/files/browser/files.contribution.ts#L143
Definitely. I was curious too, but hadn't had time until now to run some tests.
Without the
**/node_modules/**exclusion, thergprocess runs for over an hour at 1100%+ CPU in the repo my team works on. I can run the process overnight to see exactly how long it takes if that's something we're curious about.Here's some data for comparing whether
.gitis excluded. For my specific machine and repo:node_modulesExcluded.gitExcludedIt looks like excluding
.gitis fairly negligible in terms of timing. Either way, I don't think we have to do something explicit here since.gitshould be excluded unless users explicitly setfiles.excludes["**/.git"]tofalse?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to see the perf data, thanks for sharing that. Looks like it's enough to exclude "node_modules" only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this utility can get another improvement if we set the
workspaceFolderas the base part of the relative patternhttps://github.com/microsoft/vscode/blob/4b759b0492d1df969e8595e3db0f66f6058c3643/src/vscode-dts/vscode.d.ts#L2116
And then limit the search maxResults to 1
https://github.com/microsoft/vscode/blob/4b759b0492d1df969e8595e3db0f66f6058c3643/src/vscode-dts/vscode.d.ts#L12171
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created an issue to track the further optimization. #1252
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jdneo Those both look like great suggestions. Thanks!