From owner-freebsd-current@FreeBSD.ORG Tue Aug 17 21:24:35 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0E53106566C for ; Tue, 17 Aug 2010 21:24:35 +0000 (UTC) (envelope-from alan.l.cox@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6A9A98FC1A for ; Tue, 17 Aug 2010 21:24:34 +0000 (UTC) Received: by qyk4 with SMTP id 4so1555153qyk.13 for ; Tue, 17 Aug 2010 14:24:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:reply-to :in-reply-to:references:date:message-id:subject:from:to:cc :content-type; bh=GCbG49OL08nbEcOAq31/zXJFhaHFJ5/rKhLbj1CF9R8=; b=Szgi0koB3m3m09DIgd0492HarMh880Y8yhQU0CDXapNSRfAnwBJ4/6e/KvLn7hw3IS w2WH++dJoxJUZyPr8QeXpoOnq5t4yNLZMawbVbUIRHOXm1FeQpAh6iHyqso7p1sZNKXS QMjUe3CM1tB+Q6n+pYB3eR+w0lfuHqjHQ5sZM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; b=JGFIIC/AiOieBaoIrPWAOXE4iQmaLgWgEG0FmaoR8f4nlqZlDpN5eG9fS+VoaaKrgw XvloIg/+O4A2/be2/cVXBM+b+ovyfcm2iz32d27jwARxSkdnjyL/SGT4kjOWbPcUkBGE SYn9uWFvjQ71Do65GI02iXXM8Pxbrgb/CAmOg= MIME-Version: 1.0 Received: by 10.224.65.91 with SMTP id h27mr4773019qai.13.1282080274246; Tue, 17 Aug 2010 14:24:34 -0700 (PDT) Received: by 10.229.22.11 with HTTP; Tue, 17 Aug 2010 14:24:34 -0700 (PDT) In-Reply-To: <4C6AF13A.1080606@andric.com> References: <4C6505A4.9060203@FreeBSD.org> <20100813085235.GA16268@freebsd.org> <4C66C010.3040308@FreeBSD.org> <4C673F02.8000805@FreeBSD.org> <20100815013438.GA8958@troutmask.apl.washington.edu> <4C67492C.5020206@FreeBSD.org> <8639ufd78w.fsf@ds4.des.no> <4C6844D8.5070602@andric.com> <86sk2faqdl.fsf@ds4.des.no> <4C6AAA88.5080606@andric.com> <4C6AF13A.1080606@andric.com> Date: Tue, 17 Aug 2010 16:24:34 -0500 Message-ID: From: Alan Cox To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: current@freebsd.org Subject: Re: Official request: Please make GNU grep the default X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: alc@freebsd.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2010 21:24:35 -0000 On Tue, Aug 17, 2010 at 3:29 PM, Dimitry Andric wrote: > On 2010-08-17 18:29, Alan Cox wrote: > > Try it again on a memory resident file with the MAP_PREFAULT_READ option > > that is provided by this patch: > > > > http://www.cs.rice.edu/~alc/MAP_PREFAULT_READ.patch > > A time trial gives: > > grep with normal mmap() 1396s > grep with prefault mmap() 1354s > grep with regular read() 1354s > > So normal mmap is ~3% slower, and prefault mmap does not seem to make > any measurable difference. I guess the added complexity is not really > worth it, for now. > Do you know what fraction of this time is being spent in the kernel? Does the value of "sysctl vm.pmap.pde.mappings" increase as a result of your test? If not, there is still room for improvement in the results with mmap(). Alan