Subject: Re: bug#71179: [PATCH] In rgrep, check matching files before excluding files

From: Eli Zaretskii <[email-masked]>
Date: Sat, 25 May 2024 15:51:13 +0300

> Date: Sat, 25 May 2024 15:26:56 +0300
> Cc: [email-masked]
> From: Dmitry Gutov <[email-masked]>
> 
> On 25/05/2024 09:36, Eli Zaretskii wrote:
> >> From: Spencer Baugh <[email-masked]>
> >> Date: Fri, 24 May 2024 16:14:39 -0400
> >>
> >> In my benchmarking, this takes (rgrep "foo" "*.el" "~/src/emacs/trunk/")
> >> from ~410ms to ~130ms.
> > 
> > Which is a minor improvement at best, possibly a negligible one.  In
> > my testing (on MS-Windows), I see a barely-tangible improvement: 0.7%.
> 
> That's unfortunate, but I think we prioritize GNU systems when making 
> such decisions.

We do.  I just added one more data point.

> >>> In my benchmarking, this takes (rgrep "foo" "*.el" "~/src/emacs/trunk/")
> >>> from ~410ms to ~130ms.
> >>
> >> I can confirm improvement here (though not exactly 3x).
> >>
> >> 1.9s to 1.3s in a Linux checkout, for example. Nice.
> > 
> > Which is still quite minor.
> 
> A 30% improvement is nothing to sneeze at, especially for a code change 
> as simple as this one.

They are 30%, but they are only 600 milliseconds.

> >> Moving the files exclude instructions to the <F> placeholder is a slight
> >> incompatibility
> > 
> > Right, and for that reason, we cannot install this change as-is.  We
> > need either a different command or a user option controlling the order
> > (with a good explanation of the effect of the difference).
> 
> A user option might work, but before we add one it would be great to 
> understand who are the users that it is for.

The ones for whom the proposed change will affect the results.

> > Sorry, such incompatible changes are not acceptable, definitely when
> > the gain is so small.  Correctness trumps speed.
> 
> Can you think of a specific problematic usage?

Why is that needed?  Isn't it clear that it can happen?