From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: sbaugh@catern.com Newsgroups: gmane.emacs.bugs Subject: bug#64735: 29.0.92; find invocations are ~15x slower because of ignores Date: Sat, 22 Jul 2023 10:38:37 +0000 (UTC) Message-ID: <87ilaci637.fsf@catern.com> References: <874jlxebz5.fsf@gmx.de> <87lef9mqio.fsf@localhost> <87edl1scbw.fsf@gmx.de> <87fs5hmp6i.fsf@localhost> <87cz0lmoxy.fsf@localhost> <83v8edzb31.fsf@gnu.org> <87r0p1cta3.fsf@gmx.de> <87pm4ll7ox.fsf@localhost> <87a5vpcmc7.fsf@gmx.de> <878rb9l1f5.fsf@localhost> <87zg3pb6yt.fsf@gmx.de> <83zg3p9s39.fsf@gnu.org> <878rb944wi.fsf@localhost> <83tttx9q4v.fsf@gnu.org> <87pm4lb4fr.fsf@gmx.de> <83pm4l9n0o.fsf@gnu.org> <87jzutb14l.fsf@gmx.de> <83mszp9kl2.fsf@gnu.org> <83h6pwa52z.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39566"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Spencer Baugh , yantar92@posteo.net, rms@gnu.org, dmitry@gutov.dev, michael.albinus@gmx.de, 64735@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 22 12:39:23 2023 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 1qNA1C-000A7i-Am for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 Jul 2023 12:39:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNA0u-00046T-9j; Sat, 22 Jul 2023 06:39:04 -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 1qNA0s-00046L-6n for bug-gnu-emacs@gnu.org; Sat, 22 Jul 2023 06:39:02 -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 1qNA0r-0007Zh-VI for bug-gnu-emacs@gnu.org; Sat, 22 Jul 2023 06:39:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qNA0r-0007yM-Qi for bug-gnu-emacs@gnu.org; Sat, 22 Jul 2023 06:39:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: sbaugh@catern.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Jul 2023 10:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64735 X-GNU-PR-Package: emacs Original-Received: via spool by 64735-submit@debbugs.gnu.org id=B64735.169002232630626 (code B ref 64735); Sat, 22 Jul 2023 10:39:01 +0000 Original-Received: (at 64735) by debbugs.gnu.org; 22 Jul 2023 10:38:46 +0000 Original-Received: from localhost ([127.0.0.1]:35526 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qNA0c-0007xt-5S for submit@debbugs.gnu.org; Sat, 22 Jul 2023 06:38:46 -0400 Original-Received: from s.wrqvtbkv.outbound-mail.sendgrid.net ([149.72.123.24]:2592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qNA0Z-0007xd-1a for 64735@debbugs.gnu.org; Sat, 22 Jul 2023 06:38:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com; h=from:subject:in-reply-to:references:mime-version:to:cc:content-type: content-transfer-encoding:cc:content-type:from:subject:to; s=s1; bh=JmkGW7uOEyQXvznsKLr+w9z4YgZvxGiiW74fdpKaJ4k=; b=ckq71Yddpzk8yJDHWs+5/9quS+fMHiMfRpazBtAW8aW1GWpjmz00eYr3ZvbwZc/SALmZ qBchfmJVYQG/auYq6R070X2mTczO9ok/39tF2seU6jhFQdrCqtcOF5KJ8fI9QIRElq3jF/ dPU0tnz2oOE8qVJWjBdRB9zs76a+gB9+lguESmztetryf66YSESSsCnyJ4DMEzRFidMVAV 3k8o3aSLl6bvqLGuCpuB5bFeYGpP1N0ApP04WVtEQDONzCowYYJlY7in6kBNf4HEc546H7 Ng7/kEmfL1qPP/If0FdeDySmpLeGFEmmPiZlgqRR7zAh18nJVN37N+WyYVZIHWqw== Original-Received: by filterdrecv-d7bbbc8bf-hf4lw with SMTP id filterdrecv-d7bbbc8bf-hf4lw-1-64BBB1AD-F 2023-07-22 10:38:37.481541034 +0000 UTC m=+6260331.354104113 Original-Received: from earth.catern.com (unknown) by geopod-ismtpd-19 (SG) with ESMTP id M4_2X6gUQg2Lbq6FjHaRfA Sat, 22 Jul 2023 10:38:37.286 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=gnu.org Original-Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id B145B60166; Sat, 22 Jul 2023 06:38:36 -0400 (EDT) In-Reply-To: <83h6pwa52z.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 22 Jul 2023 08:27:32 +0300") X-SG-EID: ZgbRq7gjGrt0q/Pjvxk7wM0yQFRdOkTJAtEbkjCkHbIEq3B8VB07aQyhxWj0nfMRL7FquXRq3RnCJN0YKQQwVDjUc530FyHIavQw4ZLWEgDhKAvYRiAi9KjAQ3MYqbVeqAIYZTeC7gUkD1LrFWCCpgAD5zYmeo/3VdlOJP1UGGrM2TjQTXalnoB+Ey4svepamu3kVHUTOY9bTTjtj/xq2w== X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== 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:265797 Archived-At: Eli Zaretskii writes: >> From: Spencer Baugh >> Cc: Michael Albinus , dmitry@gutov.dev, >> yantar92@posteo.net, 64735@debbugs.gnu.org, Richard Stallman >> >> Date: Fri, 21 Jul 2023 15:33:13 -0400 >> >> Eli Zaretskii writes: >> > The first idea that comes to mind is to reimplement >> > directory-files-recursively in C, modeled on how Find does that. >> >> If someone was thinking of doing that, they would be better off >> responding to RMS's earlier request for C programmers to optimize this >> behavior in find. > > No, the first step is to use in Emacs what Find does today, because it > will already be a significant speedup. Why bother? directory-files-recursively is a rarely used API, as you have mentioned before in this thread. And there is a way to speed it up which will have a performance boost which is unbeatable any other way: Use find instead of directory-files-recursively, and operate on files as they find prints them. Since this runs the directory traversal in parallel with Emacs, it has a speed advantage that is impossible to match in directory-files-recursively. We can fall back to directory-files-recursively when find is not available. > Optimizing the case of a long > list of omissions should come later, as it is a minor optimization. This seems wrong. directory-files-recursively is rarely used, and rgrep is a very popular command, and this problem with find makes rgrep around ~10x slower by default. How in any world is that a minor optimization? Most Emacs users will never realize that they can speed up rgrep massively by setting grep-find-ignored-files to nil. Indeed, no-one realized that until I just pointed it out. In my experience, they just stop using rgrep in favor of other third-party packages like ripgrep, because "grep is slow".