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

From: Dmitry Gutov <[email-masked]>
Date: Fri, 24 May 2024 23:45:00 +0300

Hi Spencer,

On 24/05/2024 23:14, Spencer Baugh wrote:
> If find checks the files glob first and then the excluding glob, it has
> to do much less checking (since the files glob will substantially narrow
> down the set of files on its own), and find performance is much better.
> 
> 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.

Moving the files exclude instructions to the <F> placeholder is a slight 
incompatibility, but I wonder if there are any custom grep-find-template 
values which would be bothered by it (that's the only incompatibility I 
could think of). Perhaps those that currently don't include <X> at all?