Kelly Hall <[EMAIL PROTECTED]> wrote:
 > > From: Pieter de Goeje <[EMAIL PROTECTED]>
 > > Subject: Re: "tar -c|gzip" faster than "tar -cz"?!?
 > > 
 > > The tar|gzip command uses 18% less CPU and is 10% faster. It 
 > > is clear the HDD is the bottleneck.
 > 
 > Now it's clear to me :)
 > 
 > This makes sense if tar is single-threaded: there's only one thread of
 > execution, and it can either be waiting on the disk, or compressing
 > data.  With two processes, gzip can compress while tar blocks on disk
 > IO.

No.  During my tests there was no physical disk I/O (the
disk LED was *OFF* all the time).  So tar certainly wasn't
blocking on disk I/O.

The difference in CPU time (and wall clock time) seems
simply to be caused by different compression code.  gzip
is noticeably more efficient than libz, at least on the
OS/processor combination where I tested it (Athlon64 with
FreeBSD/i386 6.2-PRERELEASE).

Depending on the type of data, the difference is between
25% and 40%.  If the data is not compressible (like stuff
from /dev/random, or already compressed files), it's only
25%.  For very good compressible data (best case: /dev/null),
the difference is 40%.

Best regards
   Oliver

-- 
Oliver Fromme,  secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

cat man du : where Unix geeks go when they die
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to