From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#71094: [PATCH] Prefer to run find and grep in parallel in rgrep Date: Fri, 24 May 2024 19:44:41 +0200 Message-ID: <87bk4vyuie.fsf@ledu-giraud.fr> References: <86ttiq6or8.fsf@gnu.org> <8aedd0ed-58fe-4ac7-98d6-950be2d4700b@gutov.dev> <868r026jlq.fsf@gnu.org> <861q5t7vrp.fsf@gnu.org> <10f62497-dfb1-4c46-b18a-6d1100de4b6a@gutov.dev> <86wmnl6f62.fsf@gnu.org> <87pltdbu17.fsf@ledu-giraud.fr> <86r0dt66nw.fsf@gnu.org> <87le41bqvd.fsf@ledu-giraud.fr> <86o78x5e5n.fsf@gnu.org> <149bf36e-831a-47ac-a424-7a3008462561@gutov.dev> Reply-To: Manuel Giraud Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30212"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: sbaugh@janestreet.com, Eli Zaretskii , 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 Fri May 24 19:46: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 1sAYzg-0007bo-Bv for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 May 2024 19:46:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sAYzR-00074k-4Q; Fri, 24 May 2024 13:46:01 -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 1sAYzM-0006vo-Ib for bug-gnu-emacs@gnu.org; Fri, 24 May 2024 13:45:58 -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 1sAYzL-0005gd-Do for bug-gnu-emacs@gnu.org; Fri, 24 May 2024 13:45:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sAYzS-00024b-EE for bug-gnu-emacs@gnu.org; Fri, 24 May 2024 13:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Manuel Giraud Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 May 2024 17:46: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.17165727077952 (code B ref 71094); Fri, 24 May 2024 17:46:02 +0000 Original-Received: (at 71094) by debbugs.gnu.org; 24 May 2024 17:45:07 +0000 Original-Received: from localhost ([127.0.0.1]:38278 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAYyY-00024C-GG for submit@debbugs.gnu.org; Fri, 24 May 2024 13:45:07 -0400 Original-Received: from ledu-giraud.fr ([51.159.28.247]:48058) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAYyJ-00023U-T6 for 71094@debbugs.gnu.org; Fri, 24 May 2024 13:45:05 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=HZ/VZjhK RWThAJ3fnl8s3nlo1F3yYH/8hzXtw1V+QeA=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=Oj/+HtKhMkhBXc0WIwMgI7z7bPcnMT /KLCsJfNAI5YZ5s8Sy+Nw0cpC5ROimvM4uFqSyoLKNNh4a+QLHK9XsBQ== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=HZ/VZjhKRWThAJ3f nl8s3nlo1F3yYH/8hzXtw1V+QeA=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=rlGjhGwhYWrUShEvH62uKU8uuv4az0i889tRZD /Eza6WTAfW2on6RIK6m9jun/ZGwomE0wXLtDGoJAECAggxOV+kTvgpy1J5+exksIsf1WoR Uz5F+e1mEypkFP5fBHBjFuH/zr4A0cQU3OCGS8xy0Ittb/HLRHmr1C7oOSFKS1RoEJMGaF LAXZIow+kc0kOS07gSrwF8yluwO4D3vCFygCff0QXqYXao5cNoun/4+WP1gN2GLj8fUM8M ljxrDx8ioise5R3GshLXLtVomUw9Xs8fsdZzBtHTzqs8iqSLOcj5KK/J5fE204j6yZSBdf jqeq4DpgF7qD6v7QY5oprsUg== Original-Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 2e8edcd2 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 24 May 2024 19:44:42 +0200 (CEST) In-Reply-To: <149bf36e-831a-47ac-a424-7a3008462561@gutov.dev> (Dmitry Gutov's message of "Thu, 23 May 2024 16:24:11 +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:285783 Archived-At: Dmitry Gutov writes: > On 23/05/2024 07:46, Eli Zaretskii wrote: >>> From: Manuel Giraud >>> Cc:dmitry@gutov.dev,sbaugh@janestreet.com,71094@debbugs.gnu.org, >>> rgm@gnu.org >>> Date: Wed, 22 May 2024 21:15:02 +0200 >>> >>> Eli Zaretskii writes: >>> >>> [...] >>> >>>> Thanks, but we need the timings of the corresponding Emacs commands, >>>> not the commands run from the shell prompt. >>> Ok. What are those commands and how to timed them? >> It's rgrep, AFAIU, according to the original report in this bug's >> discussion. Dmitry, would you please show Manual the commands you >> were running in your benchmarks? > > 1. Visit a directory with a fair number of files. > 2. M-x rgrep, enter some odd regexp like "asdfasf@!#!" and "*" for the > files wildcard. > 3. Perform the search. Look at the end of the *grep* output, it will > say something like "duration: 4.52 s". Note the number. Thanks. Here is what I get first without and then with the patch after cache warming on both runs: --8<---------------cut here---------------start------------->8--- -*- mode: grep; default-directory: "/usr/src/" -*- Grep started at Fri May 24 19:04:44 find -H . -type d \( -path \*/SCCS -o -path \*/RCS -o -path \*/CVS -o -path \*/MCVS -o -path \*/.src -o -path \*/.svn -o -path \*/.git -o -path \*/.hg -o -path \*/.bzr -o -path \*/_MTN -o -path \*/_darcs -o -path \*/\{arch\} \) -prune -o \! -type d \( -name .\#\* -o -name \*.o -o -name \*\~ -o -name \*.bin -o -name \*.lbin -o -name \*.so -o -name \*.a -o -name \*.ln -o -name \*.blg -o -name \*.bbl -o -name \*.elc -o -name \*.lof -o -name \*.glo -o -name \*.idx -o -name \*.lot -o -name \*.fmt -o -name \*.tfm -o -name \*.class -o -name \*.fas -o -name \*.lib -o -name \*.mem -o -name \*.x86f -o -name \*.sparcf -o -name \*.dfsl -o -name \*.pfsl -o -name \*.d64fsl -o -name \*.p64fsl -o -name \*.lx64fsl -o -name \*.lx32fsl -o -name \*.dx64fsl -o -name \*.dx32fsl -o -name \*.fx64fsl -o -name \*.f x32fsl -o -name \*.sx64fsl -o -name \*.sx32fsl -o -name \*.wx64fsl -o -name \*.wx32fsl -o -name \*.fasl -o -name \*.ufsl -o -name \*.fsl -o -name \*.dxl -o -name \*.lo -o -name \*.la -o -name \*.gmo -o -name \*.mo -o -name \*.toc -o -name \*.aux -o -name \*.cp -o -name \*.fn -o -name \*.ky -o -name \*.pg -o -name \*.tp -o -name \*.vr -o -name \*.cps -o -name \*.fns -o -name \*.kys -o -name \*.pgs -o -name \*.tps -o -name \*.vrs -o -name \*.pyc -o -name \*.pyo \) -prune -o -type f \( -name \* -o -name .\* \) -exec grep -i -nH --null -e asdfasf\@\!\#\! \{\} + Grep finished with no matches found at Fri May 24 19:04:54, duration 10.2 s --8<---------------cut here---------------end--------------->8--- --8<---------------cut here---------------start------------->8--- -*- mode: grep; default-directory: "/usr/src/" -*- Grep started at Fri May 24 19:37:28 find -H . -type d \( -path \*/SCCS -o -path \*/RCS -o -path \*/CVS -o -path \*/MCVS -o -path \*/.src -o -path \*/.svn -o -path \*/.git -o -path \*/.hg -o -path \*/.bzr -o -path \*/_MTN -o -path \*/_darcs -o -path \*/\{arch\} \) -prune -o \! -type d \( -name .\#\* -o -name \*.o -o -name \*\~ -o -name \*.bin -o -name \*.lbin -o -name \*.so -o -name \*.a -o -name \*.ln -o -name \*.blg -o -name \*.bbl -o -name \*.elc -o -name \*.lof -o -name \*.glo -o -name \*.idx -o -name \*.lot -o -name \*.fmt -o -name \*.tfm -o -name \*.class -o -name \*.fas -o -name \*.lib -o -name \*.mem -o -name \*.x86f -o -name \*.sparcf -o -name \*.dfsl -o -name \*.pfsl -o -name \*.d64fsl -o -name \*.p64fsl -o -name \*.lx64fsl -o -name \*.lx32fsl -o -name \*.dx64fsl -o -name \*.dx32fsl -o -name \*.fx64fsl -o -name \*.f x32fsl -o -name \*.sx64fsl -o -name \*.sx32fsl -o -name \*.wx64fsl -o -name \*.wx32fsl -o -name \*.fasl -o -name \*.ufsl -o -name \*.fsl -o -name \*.dxl -o -name \*.lo -o -name \*.la -o -name \*.gmo -o -name \*.mo -o -name \*.toc -o -name \*.aux -o -name \*.cp -o -name \*.fn -o -name \*.ky -o -name \*.pg -o -name \*.tp -o -name \*.vr -o -name \*.cps -o -name \*.fns -o -name \*.kys -o -name \*.pgs -o -name \*.tps -o -name \*.vrs -o -name \*.pyc -o -name \*.pyo \) -prune -o -type f \( -name \* -o -name .\* \) -print0 | "xargs" -0 grep -i -nH --null -e asdfasf\@\!\#\! Grep finished with no matches found at Fri May 24 19:37:37, duration 9.01 s --8<---------------cut here---------------end--------------->8--- -- Manuel Giraud