From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh Newsgroups: gmane.emacs.bugs Subject: bug#71179: [PATCH] In rgrep, check matching files before excluding files Date: Fri, 24 May 2024 16:54:37 -0400 Message-ID: References: <2c88f75b-6407-4eab-a5a5-0c16f005cd9f@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23047"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 71179@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 24 22:55:16 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 1sAbwZ-0005iH-5h for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 May 2024 22:55:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sAbwH-00008E-CS; Fri, 24 May 2024 16:54:57 -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 1sAbwF-00007u-0E for bug-gnu-emacs@gnu.org; Fri, 24 May 2024 16:54: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 1sAbwE-0006NW-Od for bug-gnu-emacs@gnu.org; Fri, 24 May 2024 16:54:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sAbwL-0006aO-IK for bug-gnu-emacs@gnu.org; Fri, 24 May 2024 16:55:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 May 2024 20:55: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.171658409325305 (code B ref 71179); Fri, 24 May 2024 20:55:01 +0000 Original-Received: (at 71179) by debbugs.gnu.org; 24 May 2024 20:54:53 +0000 Original-Received: from localhost ([127.0.0.1]:39142 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAbwC-0006a5-Qh for submit@debbugs.gnu.org; Fri, 24 May 2024 16:54:53 -0400 Original-Received: from mxout6.mail.janestreet.com ([64.215.233.21]:50313) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAbwA-0006Zz-3C for 71179@debbugs.gnu.org; Fri, 24 May 2024 16:54:50 -0400 In-Reply-To: <2c88f75b-6407-4eab-a5a5-0c16f005cd9f@gutov.dev> (Dmitry Gutov's message of "Fri, 24 May 2024 23:45:00 +0300") DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1716584077; bh=9qP3TUh5+OFvT30cG03DCS2MQjbcLk4LO19t4Hu3mt0=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=GbqXsVdIQrBIne4G4wIScEZnBc7ZsPkjytm3UtUPhWz9huIFO2D7el1iHg0bb7VIt 2rayomHRC7/3MjNZSEiiDNiWWnXDrGUOpbMW52b3XzehYu69X1zyaLkv4KwyEdPfUO 0vl9y6rS2RuT+Ts7S4ss8uIKaqCuUUETVMt4OYAFB45Z+2lIsgZH9/itrlKBmr9aww mqVjUfszy8wCJAEZZA2zUZt7LzuGMqubxlsDPU5/tump5NTxCtD69b82Xl7DhBmD3W lvUIV2cCU3Rf31iOv4W7cSBnre1NZo2RBDzj3YFdPbXVkjH1vk+XIFYH15tunWtS+6 HxVqDl0tzpQ9Q== 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:285802 Archived-At: Dmitry Gutov writes: > 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 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. 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.