From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Why does not rgrep use "grep -r"? Date: Sat, 03 Nov 2007 10:40:02 +0200 Message-ID: References: <472B99AB.3090705@gmail.com> <87ve8k8dyw.fsf@catnip.gol.com> <472BB921.20104@gmail.com> <87d4us6rnl.fsf@catnip.gol.com> <472BD29F.5090205@gmail.com> <877il06ltg.fsf@catnip.gol.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1194079230 14107 80.91.229.12 (3 Nov 2007 08:40:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 3 Nov 2007 08:40:30 +0000 (UTC) Cc: schwab@suse.de, lennart.borgman@gmail.com, emacs-devel@gnu.org To: Miles Bader Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 03 09:40:33 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IoEYP-0007LZ-L8 for ged-emacs-devel@m.gmane.org; Sat, 03 Nov 2007 09:40:29 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IoEYF-0006iL-CU for ged-emacs-devel@m.gmane.org; Sat, 03 Nov 2007 04:40:19 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IoEYB-0006gN-2P for emacs-devel@gnu.org; Sat, 03 Nov 2007 04:40:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IoEY9-0006ei-E4 for emacs-devel@gnu.org; Sat, 03 Nov 2007 04:40:14 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IoEY9-0006eT-B4 for emacs-devel@gnu.org; Sat, 03 Nov 2007 04:40:13 -0400 Original-Received: from nitzan.inter.net.il ([213.8.233.22]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IoEY4-0002SJ-PP; Sat, 03 Nov 2007 04:40:09 -0400 Original-Received: from HOME-C4E4A596F7 (IGLD-83-130-6-194.inter.net.il [83.130.6.194]) by nitzan.inter.net.il (MOS 3.7.3a-GA) with ESMTP id IFI78200 (AUTH halo1); Sat, 3 Nov 2007 10:37:27 +0200 (IST) In-reply-to: <877il06ltg.fsf@catnip.gol.com> (message from Miles Bader on Sat, 03 Nov 2007 12:37:47 +0900) X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:82414 Archived-At: > From: Miles Bader > Date: Sat, 03 Nov 2007 12:37:47 +0900 > Cc: Andreas Schwab , Emacs Devel > > > I believed that grep had to be started many times. Is not that the case? > > xargs invokes grep in "batches," with as many filenames as will fit on > the command line; for e.g. linux, that's many thousands at once, so > process invocation overhead will tend to be in the noise compared to > file I/O overhead. Yes, but I believe "grep -r" will be still faster, even on GNU/Linux, since all it does to recurse is `readdir' and `fnmatch'; the need for writing file names to the pipe and reading them on the xargs side is avoided.