Subject: bug#78520: 31.0.50; Performance issue in dired+isearch with dired-isearch-filenames

From: Drew Adams <[email-masked]>
Date: Sat, 24 May 2025 01:41:38 +0000

> > > Would it be possible to speed this up by searching as usual, but then
> > > rejecting matches whose positions don't have the 'filename' property?
> > > Or was this tried and found to be not faster?
> 
> IIRC (and understand correctly): It had been tried and was faster, but:
> we then had dismissed this idea.  One reason was that we wanted to make
> ^ and $ match the beginning and end of the file names when using regexp
> file name isearch.  There were other reasons - lazy highlight, I don't
> recall.  There were a few problems, you find it somewhere.  The decision
> was not taken lightly - the result was just not convincing, and the
> problems not fixable in a sensible way.

Caveat: I rarely use `dired-isearch-filenames', and I've
nothing to say about improving performance of that command.

But wrt searching filenames in Dired it might sometimes
be appropriate to divide the search space (listing(s)
in the buffer), by using narrowings or `occur', before
using `dired-isearch-filenames' (or even plain Isearch).