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

feat: dont do needless search when we reach max depth #2566

Closed
wants to merge 6 commits into from

Conversation

sigmaSd
Copy link

@sigmaSd sigmaSd commented Jul 23, 2023

fix #2565

I can improve the code, if in general it seems reasonable,
seems to work in my testing

@sigmaSd
Copy link
Author

sigmaSd commented Jul 23, 2023

Btw this gets it down to 3 syscalls per entry when max depth is reached

openat(AT_FDCWD, "/home/mrcool/dev/rust/nanoserde", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 4
newfstatat(4, "", {st_mode=S_IFDIR|0755, st_size=4096, ...}, AT_EMPTY_PATH) = 0
close(4)                                = 0
openat(AT_FDCWD, "/home/mrcool/dev/rust/message-io", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 4
newfstatat(4, "", {st_mode=S_IFDIR|0755, st_size=4096, ...}, AT_EMPTY_PATH) = 0
close(4)                                = 0
openat(AT_FDCWD, "/home/mrcool/dev/rust/mun_example", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 4
newfstatat(4, "", {st_mode=S_IFDIR|0755, st_size=4096, ...}, AT_EMPTY_PATH) = 0
close(4)                                = 0
openat(AT_FDCWD, "/home/mrcool/dev/rust/progress", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 4
newfstatat(4, "", {st_mode=S_IFDIR|0755, st_size=4096, ...}, AT_EMPTY_PATH) = 0

But I imagine even those are not needed, but I guess its probably negligible

@BurntSushi
Copy link
Owner

Thank you, but I'm going to pass on this for now. I hope to do an overhaul of the ignore crate soon, and I'll see if it makes sense to take max depth into account at a more fundamental level. I'm not quite comfortable with this change as-is because I think it's a little too hacky. (Which isn't your fault. The crate's internals are an awful mess and I barely understand it any more.)

@BurntSushi BurntSushi closed this Sep 18, 2023
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.

perf(ignore): don't search subdirs for git/ignore files if max depth is reached
2 participants