tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bsdcpio and bsdtar installed by default



On Thu, Jun 05, 2008 at 01:38:58PM -0400, Greg A. Woods; Planix, Inc. wrote:
> However I'm not so sure it's a good idea to use libarchive from programs 
> that want to unpack things instead of invoking dedicated archive programs 
> as separate processes, just as I'm not so sure it's a good idea to use 
> compression and decompression APIs directly instead of starting separate 
> processes running dedicated compression and decompression programs.

For gzip/libz based compression, I think the overhead of pipe is clearly
as large as the gain from running on different cores (e.g. sharing L2
caches). For bzip2 the ratio changes somewhat, but it seems like the
overhead due to pipe usage and the additional cache trashing are mostly
compensating each other.

For my Core2 laptop (hw.ncpu=2):

bsdtar xf libX11-1.1.3.tar.bz2
1.18s user 0.12s system 99% cpu 1.305 total

bsdtar --use-compress-program /usr/bin/bunzip2 -xf libX11-1.1.3.tar.bz2
1.25s user 0.16s system 109% cpu 1.285 total

The former uses internal lbibz2 handling, the second call uses the
external program. Both cases to tmpfs. So while it is slightly faster to
use the external program, it means 10% more over all resource usage.
For extraction to a real file system, the situation will change somewhat
as the operations are generally IO bound in that case.

Joerg


Home | Main Index | Thread Index | Old Index