From owner-freebsd-hackers Thu Jul 29 16:26: 0 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [209.157.86.2]) by hub.freebsd.org (Postfix) with ESMTP id 0609A15680 for ; Thu, 29 Jul 1999 16:25:58 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.3/8.9.1) id QAA80121; Thu, 29 Jul 1999 16:25:12 -0700 (PDT) (envelope-from dillon) Date: Thu, 29 Jul 1999 16:25:12 -0700 (PDT) From: Matthew Dillon Message-Id: <199907292325.QAA80121@apollo.backplane.com> To: James Howard Cc: Tim Vanderhoek , "Daniel C. Sobral" , freebsd-hackers@FreeBSD.ORG Subject: Re: replacing grep(1) References: Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG :of me. Unfortunetly he has not posted this version yet so I cannot :download it and run it myself. He also says that if mmap fails, he drops :back to stdio. This should only happen in the NFS case, the > 2G case, :etc. It should only be the > 2G case or the pipe case. mmap() works just fine over NFS. I would not expect a huge speed increase using mmap over read. mmap() tends to be a lot harder on the system then read() (though we are working on that), especially if you are scanning large files. Avoiding buffer copies is good, but keep in mind that the cost of accessing a location in memory is essentially 0 if the memory is already in the L1 cache. So while you may get an improvement going from read() to mmap(), which avoids large buffer copies, you will not see much of an improvement removing redundancy from the line scan. -Matt Matthew Dillon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message