From owner-freebsd-current@FreeBSD.ORG Sat Aug 21 11:53:40 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFC441065696; Sat, 21 Aug 2010 11:53:40 +0000 (UTC) (envelope-from prvs=18493e2b7e=killing@multiplay.co.uk) Received: from mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) by mx1.freebsd.org (Postfix) with ESMTP id 5AE8F8FC1B; Sat, 21 Aug 2010 11:53:40 +0000 (UTC) X-MDAV-Processed: mail1.multiplay.co.uk, Sat, 21 Aug 2010 12:42:57 +0100 X-Spam-Processed: mail1.multiplay.co.uk, Sat, 21 Aug 2010 12:42:57 +0100 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail1.multiplay.co.uk X-Spam-Level: X-Spam-Status: No, score=-5.0 required=6.0 tests=USER_IN_WHITELIST shortcircuit=ham autolearn=disabled version=3.2.5 Received: from r2d2 by mail1.multiplay.co.uk (MDaemon PRO v10.0.4) with ESMTP id md50011105508.msg; Sat, 21 Aug 2010 12:42:56 +0100 X-Authenticated-Sender: Killing@multiplay.co.uk X-MDRemoteIP: 188.220.16.49 X-Return-Path: prvs=18493e2b7e=killing@multiplay.co.uk X-Envelope-From: killing@multiplay.co.uk Message-ID: From: "Steven Hartland" To: , "Mike Haertel" References: <201008210231.o7L2VRvI031700@ducky.net> Date: Sat, 21 Aug 2010 12:42:52 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 Cc: freebsd-current@freebsd.org Subject: Re: why GNU grep is fast X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2010 11:53:41 -0000 That's a good read for other things as Mike, thanks for taking the time to pass on this knowledge :) ----- Original Message ----- From: "Mike Haertel" To: > Anyway, just FYI, here's a quick summary of where GNU grep gets > its speed. Hopefully you can carry these ideas over to BSD grep. > > #1 trick: GNU grep is fast because it AVOIDS LOOKING AT > EVERY INPUT BYTE. > > #2 trick: GNU grep is fast because it EXECUTES VERY FEW > INSTRUCTIONS FOR EACH BYTE that it *does* look at. ... ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 or return the E.mail to postmaster@multiplay.co.uk.