unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Spencer Baugh <sbaugh@janestreet.com>
Cc: 71179@debbugs.gnu.org
Subject: bug#71179: [PATCH] In rgrep, check matching files before excluding files
Date: Sat, 25 May 2024 09:36:45 +0300	[thread overview]
Message-ID: <86jzji1jpe.fsf@gnu.org> (raw)
In-Reply-To: <ierle3zotlc.fsf@janestreet.com> (message from Spencer Baugh on Fri, 24 May 2024 16:14:39 -0400)

> From: Spencer Baugh <sbaugh@janestreet.com>
> 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%.

> Date: Fri, 24 May 2024 23:45:00 +0300
> From: Dmitry Gutov <dmitry@gutov.dev>
> 
> > 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.

> 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).

> Cc: 71179@debbugs.gnu.org
> From: Spencer Baugh <sbaugh@janestreet.com>
> Date: Fri, 24 May 2024 16:54:37 -0400
> 
> > 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?
> 
> A grep-find-template that doesn't include <X> will indeed start seeing
> ignores based on grep-find-ignored-files in rgrep.  But, such a user can
> just set grep-find-ignored-files to nil and then they'll stop seeing
> ignores again.

That's not a valid argument for changing the default behavior.
Because I could counter-argue that if you don't care about the order
and want those few hundreds of millisecond at all costs, then _you_
can customize the template to your liking, leaving the default
behavior intact.

> Also, for what it's worth, note that the documentation for
> grep-find-template says this:
> 
>   <X> - find options to restrict or expand the directory list
>   <F> - find options to limit the files matched
> 
> So this change makes the documentation more accurate: <X> previously
> also affected the files matched, but now it only affects the directory
> list, as documented.  <F> continues to limit the files matched, as
> before.

Sorry, such incompatible changes are not acceptable, definitely when
the gain is so small.  Correctness trumps speed.





  parent reply	other threads:[~2024-05-25  6:36 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-24 20:14 bug#71179: [PATCH] In rgrep, check matching files before excluding files Spencer Baugh
2024-05-24 20:45 ` Dmitry Gutov
2024-05-24 20:54   ` Spencer Baugh
2024-05-25 12:31     ` Dmitry Gutov
2024-05-26  6:50       ` Juri Linkov
2024-05-26 12:48         ` Spencer Baugh
2024-05-26 12:56         ` Dmitry Gutov
2024-05-25  6:36 ` Eli Zaretskii [this message]
2024-05-25 12:26   ` Dmitry Gutov
2024-05-25 12:51     ` Eli Zaretskii
2024-05-25 13:03       ` Dmitry Gutov
2024-05-25 13:45         ` Eli Zaretskii
2024-05-25 13:58           ` Dmitry Gutov
2024-05-25 13:36       ` Spencer Baugh
2024-05-25 13:56         ` Eli Zaretskii
2024-05-25 14:02           ` Spencer Baugh
2024-05-25 14:13             ` Eli Zaretskii
2024-05-25 14:47               ` Dmitry Gutov
2024-05-25 15:07                 ` Eli Zaretskii
2024-05-26 13:42                   ` Spencer Baugh
2024-06-01 14:15                     ` Eli Zaretskii
2024-06-02 10:46                       ` Stefan Kangas
2024-05-25 14:51               ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86jzji1jpe.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=71179@debbugs.gnu.org \
    --cc=sbaugh@janestreet.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).