[bug #58197] "find" fails to optimize "-path /usr/foo -o -path /usr/bar" to "-regex '/usr/\(foo\|bar\)'"

2024-05-19 Thread James Youngman
Update of bug #58197 (group findutils): Severity: 3 - Normal => 1 - Wish ___ Reply to this item at: ___

[bug #58197] "find" fails to optimize "-path /usr/foo -o -path /usr/bar" to "-regex '/usr/\(foo\|bar\)'"

2023-07-21 Thread Spencer Baugh
Follow-up Comment #5, bug #58197 (project findutils): regex-opt only works for fixed strings. If you have further Emacs-specific ideas you can reply to https://debbugs.gnu.org/cgi/bugreport.cgi?bug=64735 let's try to keep this thread for strategies that would work for any find user.

[bug #58197] "find" fails to optimize "-path /usr/foo -o -path /usr/bar" to "-regex '/usr/\(foo\|bar\)'"

2023-07-21 Thread James Youngman
Follow-up Comment #4, bug #58197 (project findutils): I think for rgrep the most obvious improvement is to use the existing Emacs LISP function regex-opt on the list of extensions to generate a more efficient find command-line. ___

Re: [bug #58197] "find" fails to optimize "-path /usr/foo -o -path /usr/bar" to "-regex '/usr/\(foo\|bar\)'"

2023-07-20 Thread Nikolaos Chatzikonstantinou
> On 19 Jul 2023, at 11:52 PM, Spencer Baugh wrote: > > Follow-up Comment #3, bug #58197 (project findutils): > > One use case is GNU Emacs which heavily uses find, for example in M-x rgrep. > Emacs often constructs find commands which look like this by default: > > find -H . \( -path

[bug #58197] "find" fails to optimize "-path /usr/foo -o -path /usr/bar" to "-regex '/usr/\(foo\|bar\)'"

2023-07-19 Thread Spencer Baugh
Follow-up Comment #3, bug #58197 (project findutils): One use case is GNU Emacs which heavily uses find, for example in M-x rgrep. Emacs often constructs find commands which look like this by default: find -H . \( -path \*/SCCS/\* -o -path \*/RCS/\* -o -path \*/CVS/\* -o -path \*/MCVS/\* -o

[bug #58197] "find" fails to optimize "-path /usr/foo -o -path /usr/bar" to "-regex '/usr/\(foo\|bar\)'"

2022-05-18 Thread Bernhard Voelker
Follow-up Comment #2, bug #58197 (project findutils): The main point about the optimizer in find(1) is to avoid costly activities when cheap ones can already rule out that the current item has to be processed further. Costly activities are e.g. extra stat() calls. Cheap activities are evaluating

[bug #58197] "find" fails to optimize "-path /usr/foo -o -path /usr/bar" to "-regex '/usr/\(foo\|bar\)'"

2022-05-17 Thread zhoushuiqing
Follow-up Comment #1, bug #58197 (project findutils): $find ... -regex ".. | .." $find ... -path.. -o -path .. they are not the same in the expression tree. $find -D tree ... As we can see from the result of this command, -regex on a leaf alone, two -path on two leaves. While searching for