From owner-freebsd-hackers@FreeBSD.ORG Sun Jun 17 07:24:16 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 768F216A46B for ; Sun, 17 Jun 2007 07:24:16 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (c220-239-20-82.belrs4.nsw.optusnet.com.au [220.239.20.82]) by mx1.freebsd.org (Postfix) with ESMTP id D85CA13C458 for ; Sun, 17 Jun 2007 07:24:15 +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 l5H7OEt2021978; Sun, 17 Jun 2007 17:24:14 +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 l5H7OEC4021977; Sun, 17 Jun 2007 17:24:14 +1000 (EST) (envelope-from peter) Date: Sun, 17 Jun 2007 17:24:14 +1000 From: Peter Jeremy To: Garrett Cooper Message-ID: <20070617072414.GA1173@turion.vk2pj.dyndns.org> References: <46703EE9.1030804@freebsd.org> <4674B268.4030502@u.washington.edu> <4674BE32.300@freebsd.org> <4674D917.7000502@u.washington.edu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="f5QefDQHtn8hx44O" Content-Disposition: inline In-Reply-To: <4674D917.7000502@u.washington.edu> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.15 (2007-04-06) Cc: hackers@freebsd.org, Tim Kientzle Subject: Re: Using shell commands versus C equivalents 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: Sun, 17 Jun 2007 07:24:16 -0000 --f5QefDQHtn8hx44O Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2007-Jun-16 23:47:51 -0700, Garrett Cooper w= rote: > Tim Kientzle wrote: >> The biggest time sink in pkg_add is writing each file to a temp >> dir then copying it to its final location. There are a couple =2E.. > Hmmm.. not sure if you're referring to the temp creation of files in t= he=20 > playpen portion of the set of programs, or something else, but as I see i= t=20 > the playpen idea is a good one because it's like the Gentoo Linux version= of=20 > a sandbox, and in case something goes wrong during an install or the user= =20 > backs out, that's the way to go when dealing with a partially created /= =20 > installed package. For the best of both worlds, put the files into the final location (or at least in the same FS) with a temporary name. Once you're satisfied that everything is OK, you can rename the files to their final names. This is a comparatively cheap operation (as long as you aren't running UFS without softupdates). > I'll definitely look into strace'ing (not really a big fan of truss(1)= =20 > yet) the operation though, just to see how fast or slow stuff is. ktrace can also provide timings. --=20 Peter Jeremy --f5QefDQHtn8hx44O Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFGdOGe/opHv/APuIcRArJrAJ9b0czHdou6h8cgtvmKDntRYy20EQCfSzXz QuAA/QE8aKgcQZbMNMRLE5o= =8974 -----END PGP SIGNATURE----- --f5QefDQHtn8hx44O--