From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#71179: [PATCH] In rgrep, check matching files before excluding files Date: Sat, 25 May 2024 09:36:45 +0300 Message-ID: <86jzji1jpe.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15922"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71179@debbugs.gnu.org To: Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 25 08:38:25 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sAl2u-0003uV-WF for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 May 2024 08:38:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sAl2V-0000q1-IP; Sat, 25 May 2024 02:37:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sAl2R-0000pg-7j for bug-gnu-emacs@gnu.org; Sat, 25 May 2024 02:37:55 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sAl2Q-0001Lk-Iz for bug-gnu-emacs@gnu.org; Sat, 25 May 2024 02:37:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sAl2X-0003MD-P1 for bug-gnu-emacs@gnu.org; Sat, 25 May 2024 02:38:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 May 2024 06:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71179 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 71179-submit@debbugs.gnu.org id=B71179.171661902812880 (code B ref 71179); Sat, 25 May 2024 06:38:01 +0000 Original-Received: (at 71179) by debbugs.gnu.org; 25 May 2024 06:37:08 +0000 Original-Received: from localhost ([127.0.0.1]:41476 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAl1f-0003Lg-P7 for submit@debbugs.gnu.org; Sat, 25 May 2024 02:37:08 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45810) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAl1d-0003LI-Oh for 71179@debbugs.gnu.org; Sat, 25 May 2024 02:37:06 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sAl1Q-000186-Sj; Sat, 25 May 2024 02:36:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=xm3JBJJb/qytR+Wj1sWP6sbrxd7uMKg8ihm69+0kva0=; b=ZtpA2p3gVyHY 8W+LL3TfPwJqzODSro3ihTU1EtrynSXKs5Kkw5XdqPLTncSXTO4WWOUVItLlUrCX7zGJ9SqM7Psat gTvS7O2qo7NrfHsWc79Xj8sstx0Dkf0UNJhSsRIPKw6tn5R7wrilg1hoxZruKp+o3xgbRFrTlcXIm MRXEfjOCjDTzO6VdYeByIlLBhXKqWsDTT1DBBQ74taMQaGAYYnFY7tTYJedOnajfxzXORB874u0sO YGuCc+v9X9tSvJimjjyAzk+Q6DwztMkbrEsB4jRxo9/d1cHRqghAWkoq9xUdpmms5RglWztJY5MZd UkpeqyMSqyJTb7gUSdcavA==; In-Reply-To: (message from Spencer Baugh on Fri, 24 May 2024 16:14:39 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:285815 Archived-At: > From: Spencer Baugh > 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 > > > 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 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 > Date: Fri, 24 May 2024 16:54:37 -0400 > > > Moving the files exclude instructions to the 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 at all? > > A grep-find-template that doesn't include 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: > > - find options to restrict or expand the directory list > - find options to limit the files matched > > So this change makes the documentation more accurate: previously > also affected the files matched, but now it only affects the directory > list, as documented. 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.