Using shell commands versus C equivalents

Peter Jeremy peterjeremy at optushome.com.au
Sun Jun 17 07:24:16 UTC 2007


On 2007-Jun-16 23:47:51 -0700, Garrett Cooper <youshi10 at u.washington.edu> wrote:
> 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
...
>    Hmmm.. not sure if you're referring to the temp creation of files in the 
> playpen portion of the set of programs, or something else, but as I see it 
> the playpen idea is a good one because it's like the Gentoo Linux version of 
> a sandbox, and in case something goes wrong during an install or the user 
> backs out, that's the way to go when dealing with a partially created / 
> 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) 
> yet) the operation though, just to see how fast or slow stuff is.

ktrace can also provide timings.

-- 
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20070617/6bbe10e0/attachment.pgp


More information about the freebsd-hackers mailing list