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

Do not walk ignored directories #148

Closed
nielsbasjes opened this issue Sep 22, 2024 · 3 comments
Closed

Do not walk ignored directories #148

nielsbasjes opened this issue Sep 22, 2024 · 3 comments
Assignees

Comments

@nielsbasjes
Copy link
Owner

Followup of #124 where @vincentjames501 mentions this problem:

I noticed that on some of our larger java projects and especially large webapps/node projects the tool was taking forever. Turns out it's Files.find. It naively walks every folder even gitignored ones so when it walks a massive folder like node_modules/ or even some large target/ directories it can take forever. Just to test some things out, I found I could speed things up orders of magnitude by using Files.walkFileTree(path, new FileVisitor<>() {: https://github.com/vincentjames501/codeowners-cli/blob/main/src/main/java/org/vincentjames501/codeowners/commands/ListCodeOwners.java#L82
As this gives the ability to skip traversing ignored directories entirely. I don't like all this mutability and I'm sure it could be rewritten to be some recursive/lazy stream but wanted to get something working first.

Or simply put: An already ignored directory should be skipped in the finding of files.

@nielsbasjes
Copy link
Owner Author

Fixed

@nielsbasjes
Copy link
Owner Author

And part of the 1.8.0 release

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

No branches or pull requests

1 participant