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: ignore the gitignored files in the scan to improve performance #3975

Closed
wants to merge 3 commits into from

Conversation

aminya
Copy link
Contributor

@aminya aminya commented Jan 6, 2023

Fixes #3047

This uses globify-gitignore to get the glob patterns of the gitignore file at the root and appends those to the ignore pattern of the glob package. This significantly improves the performance of cspell as those directories are excluded in the scan.

I see speeds up of 3x to 10x depending on the size of the project!

@Jason3S
Copy link
Collaborator

Jason3S commented Jan 10, 2023

@aminya,

Thank you for the PR. I'll take a closer look in a few days.

@Jason3S
Copy link
Collaborator

Jason3S commented Jan 13, 2023

@aminya,

Thank you for the PR. After reading through your suggestion, I realized that the GitIgnore code already had a list of globs, it just wasn't exposing them. I have added an interface in #4009. Please see if that works in your PR.

@Jason3S
Copy link
Collaborator

Jason3S commented May 2, 2024

@aminya,

Thank you for trying this approach. I'm going to close this PR. A deeper dive is needed to make it work.

Kind regards,
Jason

@Jason3S Jason3S closed this May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Patterns in Git ignore do not improve the scanning performance unlike direct ignorePaths
2 participants