From owner-freebsd-current@FreeBSD.ORG Thu Aug 19 21:54:59 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 629261065673; Thu, 19 Aug 2010 21:54:59 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 19CED8FC1A; Thu, 19 Aug 2010 21:54:59 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id B1FDF46B45; Thu, 19 Aug 2010 17:54:58 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9FAFA8A03C; Thu, 19 Aug 2010 17:54:57 -0400 (EDT) From: John Baldwin To: freebsd-current@freebsd.org Date: Thu, 19 Aug 2010 13:39:54 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100217; KDE/4.4.5; amd64; ; ) References: <4C6505A4.9060203@FreeBSD.org> <4C6D3BBB.7030104@andric.com> In-Reply-To: <4C6D3BBB.7030104@andric.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201008191339.54279.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 19 Aug 2010 17:54:57 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00, DATE_IN_PAST_03_06 autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: alc@freebsd.org, Dimitry Andric Subject: Re: Official request: Please make GNU grep the default 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: Thu, 19 Aug 2010 21:54:59 -0000 On Thursday, August 19, 2010 10:12:11 am Dimitry Andric wrote: > On 2010-08-17 23:24, Alan Cox wrote: > >> 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? > > I ran 100 trials again, but now using "time -a -o logfile", so I could > run ministat over the accumulated results. This gives: > > x gnugrep > + bsdgrep-r210927 (the initial version that started this thread) > * bsdgrep-r211490 (current version) > % bsdgrep-r211490-mmap-plain > # bsdgrep-r211490-mmap-prefault > > Real time: > N Min Max Median Avg Stddev > x 100 1.15 1.98 1.18 1.2122 0.11159613 > + 100 8.57 14.26 8.79 9.1823 1.0496126 > * 100 2.81 6.57 2.91 3.0189 0.4304259 > % 100 2.34 4.03 2.99 3.0022 0.12635992 > # 100 2.85 3.49 2.88 2.8981 0.075232904 > > User time: > N Min Max Median Avg Stddev > x 100 0 0.07 0.03 0.0239 0.015627934 > + 100 1.6 3.33 1.9 1.976 0.30264824 > * 100 0.29 1 0.39 0.4004 0.08696824 > % 100 1.8 3.56 2.73 2.7274 0.13260117 > # 100 2.78 3.04 2.81 2.8238 0.04039652 > > System time: > N Min Max Median Avg Stddev > x 100 1.08 1.91 1.15 1.1809 0.10953617 > + 100 6.55 10.9 6.94 7.1905 0.77911809 > * 100 2.38 5.5 2.53 2.6061 0.35068445 > % 100 0.18 0.53 0.25 0.2645 0.053586049 > # 100 0.03 0.54 0.06 0.0668 0.052259647 > > E.g. it looks like bsdgrep with 'plain' mmap performs almost the same > as the regular bsdgrep (both around 3.0s average), but with mmap much > more of the time is spent in user mode. I would add user and system time together and compare the total time. Given that statclock only fires at 128 hz, and we use those counts to subdivide rux_runtime, I don't put much faith in user vs system time for benchmarks, only the total runtime in rux_runtime (which is user + system) is truly accurate. -- John Baldwin