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#71094: [PATCH] Prefer to run find and grep in parallel in rgrep Date: Wed, 22 May 2024 16:50:57 +0300 Message-ID: <868r026jlq.fsf@gnu.org> References: <86ttiq6or8.fsf@gnu.org> <8aedd0ed-58fe-4ac7-98d6-950be2d4700b@gutov.dev> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22490"; mail-complaints-to="usenet@ciao.gmane.io" Cc: sbaugh@janestreet.com, 71094@debbugs.gnu.org, rgm@gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 22 15:52:17 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 1s9mO7-0005c6-Q6 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 May 2024 15:52:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s9mNq-0007Tf-Mv; Wed, 22 May 2024 09:51:58 -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 1s9mNp-0007Rb-LT for bug-gnu-emacs@gnu.org; Wed, 22 May 2024 09:51:57 -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 1s9mNp-0004ah-CN for bug-gnu-emacs@gnu.org; Wed, 22 May 2024 09:51:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s9mNu-0003BK-Gl for bug-gnu-emacs@gnu.org; Wed, 22 May 2024 09:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 May 2024 13:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71094 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 71094-submit@debbugs.gnu.org id=B71094.171638588612224 (code B ref 71094); Wed, 22 May 2024 13:52:02 +0000 Original-Received: (at 71094) by debbugs.gnu.org; 22 May 2024 13:51:26 +0000 Original-Received: from localhost ([127.0.0.1]:56085 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s9mNK-0003B6-4i for submit@debbugs.gnu.org; Wed, 22 May 2024 09:51:26 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s9mNF-0003B0-Bz for 71094@debbugs.gnu.org; Wed, 22 May 2024 09:51:25 -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 1s9mN3-0004WR-A7; Wed, 22 May 2024 09:51:09 -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=3mgLK622PPzlHzwbBWyjSaNUhrzmJ4yiWyFVL4xzynQ=; b=Urzbnn7oqSSU L1BEHOMsoddyjiNFZMRfW9sMteEaGptVeRJ7AKOViluH98ncpa9RaAnEfqRzNcDNB92LWSxkMLqQw Si/IIXl9rBv7aE0MiJF24GOyvlp3y3dIg7K4XG3Lh5jm7zE2adSn4t89go4rExcCtf3MrnVQdAM7c ul9244VCBd5MXVbIKhHRJk0SjZM0Qa4uVTnWoX23P21efaY9opQ0t40QlBjQftFKcJSHr1yHOHs0c aP1uQtrDGpU8+JvYI+bVC7WyqJ+oAABvL847twxCNEFHywE4wLENS/jlOxESlISz9cMQHWj9BELIv sW+w771lUVa+f4EBMVOCDQ==; In-Reply-To: <8aedd0ed-58fe-4ac7-98d6-950be2d4700b@gutov.dev> (message from Dmitry Gutov on Wed, 22 May 2024 15:34:06 +0300) 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:285621 Archived-At: > Date: Wed, 22 May 2024 15:34:06 +0300 > Cc: 71094@debbugs.gnu.org, rgm@gnu.org > From: Dmitry Gutov > > On 22/05/2024 14:59, Eli Zaretskii wrote: > > > With how many files did you measure the 40% speedup? Can you show the > > performance with much fewer and much more files than what you used? > > FWIW my test indicated that for a smaller project (such as Emacs) the > difference is fairly small - the new code is slightly better or the same. > > The directory where I saw significant improvement has 300K files. That's what I thought. So we are changing the decade-old defaults to favor huge directories, which is not necessarily the wisest thing to do. > > I > > suspect that the effect depends on that. (It also depends on the > > system limit on the number of files and the length of the command line > > that xargs can use.) The argument about 'find' waiting is no longer > > relevant with 'exec-plus', since in most cases there will be just one > > invocation of 'grep'. > > If there's just one invocation, wouldn't that mean that it will happen > at the end of the full directory scan? Rather than in parallel. That's true, but what is your mental model of how the pipe with xargs works in practice? How many invocations of grep will xargs do, and when will the first invocation happen?