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

Optimize -path foo -o -path bar expressions #109

Open
catern opened this issue Jul 19, 2023 · 2 comments
Open

Optimize -path foo -o -path bar expressions #109

catern opened this issue Jul 19, 2023 · 2 comments

Comments

@catern
Copy link

catern commented Jul 19, 2023

bfs, like GNU find (see https://savannah.gnu.org/bugs/index.php?58197 ) does not optimize -path foo -o -path bar expressions. As far as I can tell, it just checks each -path operand linearly. As you can see in the linked bug, this causes slowdowns for some common find use-cases, including ones in GNU Emacs.

Could you consider optimizing this?

@tavianator
Copy link
Owner

Oof that is quite the expression tree. I'm not opposed to optimizing this kind of thing, but it's likely to be kinda hard.

@tavianator
Copy link
Owner

For the record, special-casing -path '*.foo' to use strcmp() instead of fnmatch() speeds up that command line by 3.6x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants