From owner-freebsd-hackers@FreeBSD.ORG Tue May 29 10:34:32 2007 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6937916A4F1; Tue, 29 May 2007 10:34:32 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (c220-239-3-125.belrs4.nsw.optusnet.com.au [220.239.3.125]) by mx1.freebsd.org (Postfix) with ESMTP id C900813C4BD; Tue, 29 May 2007 10:34:31 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by turion.vk2pj.dyndns.org (8.14.1/8.14.1) with ESMTP id l4TAYU09092399; Tue, 29 May 2007 20:34:30 +1000 (EST) (envelope-from peter@turion.vk2pj.dyndns.org) Received: (from peter@localhost) by turion.vk2pj.dyndns.org (8.14.1/8.14.1/Submit) id l4TAYTnM092394; Tue, 29 May 2007 20:34:29 +1000 (EST) (envelope-from peter) Date: Tue, 29 May 2007 20:34:29 +1000 From: Peter Jeremy To: Stephen Montgomery-Smith , ports@freebsd.org, hackers@freebsd.org Message-ID: <20070529103429.GD70055@turion.vk2pj.dyndns.org> References: <4659EF80.70100@math.missouri.edu> <20070527223048.GA37505@icarus.home.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MnLPg7ZWsaic7Fhd" Content-Disposition: inline In-Reply-To: <20070527223048.GA37505@icarus.home.lan> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.15 (2007-04-06) Cc: Subject: Re: Looking for speed increases in "make index" and pkg_version for ports X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 May 2007 10:34:32 -0000 --MnLPg7ZWsaic7Fhd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2007-May-27 15:30:48 -0700, Jeremy Chadwick wrote: >This sounds like a good solution. In fact, I'm lead to believe that >heavy reliance on /bin/sh is part of why the ports collection is slow. Someone needs to enable accounting on a recent -current (with the high-resolution accounting records) and look at where the time is actually going. (My -current box needs upgrading before I could do this). That said, /bin/sh is dynamically linked and a fork/exec is not cheap. Some quick-and-not-necessarily-reliable tests on 6.2-STABLE/amd64 show that /bin/sh takes about 2.5 times as long to start as /rescue/sh (though it's only 2:1 on i386). (These are different boxes so the absolute times aren't comparable). amd64% time sh -c 'i=3D0; while [ $i -lt 10000 ]; do i=3D$(($i+1)); echo fo= o; done' >/dev/null sh -c 'i=3D0; while [ $i -lt 10000 ]; do i=3D$(($i+1)); echo foo; done' > = 0.20s user 0.08s system 98% cpu 0.283 total amd64% time sh -c 'i=3D0; while [ $i -lt 10000 ]; do i=3D$(($i+1)); echo fo= o; done' >/dev/null=20 sh -c 'i=3D0; while [ $i -lt 10000 ]; do i=3D$(($i+1)); echo foo; done' > = 0.22s user 0.06s system 97% cpu 0.287 total amd64% time sh -c 'i=3D0; while [ $i -lt 10000 ]; do i=3D$(($i+1)); echo fo= o; done' >/dev/null sh -c 'i=3D0; while [ $i -lt 10000 ]; do i=3D$(($i+1)); echo foo; done' > = 0.19s user 0.10s system 98% cpu 0.288 total amd64% time sh -c 'i=3D0; while [ $i -lt 10000 ]; do i=3D$(($i+1)); /rescue= /sh -c "echo foo"; done' >/dev/null sh -c > /dev/null 0.84s user 6.12s system 97% cpu 7.162 total amd64% time sh -c 'i=3D0; while [ $i -lt 10000 ]; do i=3D$(($i+1)); /rescue= /sh -c "echo foo"; done' >/dev/null sh -c > /dev/null 1.12s user 6.05s system 97% cpu 7.366 total amd64% time sh -c 'i=3D0; while [ $i -lt 10000 ]; do i=3D$(($i+1)); /bin/sh= -c "echo foo"; done' >/dev/null sh -c > /dev/null 5.72s user 13.40s system 96% cpu 19.734 total amd64% time sh -c 'i=3D0; while [ $i -lt 10000 ]; do i=3D$(($i+1)); /bin/sh= -c "echo foo"; done' >/dev/null=20 sh -c > /dev/null 5.97s user 12.89s system 97% cpu 19.407 total amd64% =20 i386% time sh -c 'i=3D0; while [ $i -lt 10000 ]; do i=3D$(($i+1)); echo foo= ; done' >/dev/null sh -c 'i=3D0; while [ $i -lt 10000 ]; do i=3D$(($i+1)); echo foo; done' > = 0.17s user 0.03s system 95% cpu 0.208 total i386% time sh -c 'i=3D0; while [ $i -lt 10000 ]; do i=3D$(($i+1)); echo foo= ; done' >/dev/null sh -c 'i=3D0; while [ $i -lt 10000 ]; do i=3D$(($i+1)); echo foo; done' > = 0.17s user 0.03s system 99% cpu 0.199 total i386% time sh -c 'i=3D0; while [ $i -lt 10000 ]; do i=3D$(($i+1)); echo foo= ; done' >/dev/null sh -c 'i=3D0; while [ $i -lt 10000 ]; do i=3D$(($i+1)); echo foo; done' > = 0.16s user 0.04s system 99% cpu 0.200 total i386% time sh -c 'i=3D0; while [ $i -lt 10000 ]; do i=3D$(($i+1)); /rescue/= sh -c "echo foo"; done' >/dev/null sh -c > /dev/null 3.68s user 18.19s system 98% cpu 22.212 total i386% time sh -c 'i=3D0; while [ $i -lt 10000 ]; do i=3D$(($i+1)); /rescue/= sh -c "echo foo"; done' >/dev/null sh -c > /dev/null 3.34s user 18.54s system 98% cpu 22.110 total i386% time sh -c 'i=3D0; while [ $i -lt 10000 ]; do i=3D$(($i+1)); /bin/sh = -c "echo foo"; done' >/dev/null=20 sh -c > /dev/null 12.03s user 29.42s system 98% cpu 41.965 total i386% time sh -c 'i=3D0; while [ $i -lt 10000 ]; do i=3D$(($i+1)); /bin/sh = -c "echo foo"; done' >/dev/null sh -c > /dev/null 12.20s user 29.25s system 98% cpu 41.975 total --=20 Peter Jeremy --MnLPg7ZWsaic7Fhd Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFGXAG1/opHv/APuIcRAks8AKCdrEBJKOJKodeq4N+IAMNh4AKvrwCfQdGP CxG8wrZlvsAwy/UGKRfiuzc= =lNGY -----END PGP SIGNATURE----- --MnLPg7ZWsaic7Fhd--