Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Oct 2006 19:28:37 +0200 (CEST)
From:      Oliver Fromme <olli@lurza.secnetix.de>
To:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: "tar -c|gzip" faster than "tar -cz"?!?
Message-ID:  <200610131728.k9DHSb2P042016@lurza.secnetix.de>
In-Reply-To: <00C5463E8A5F7C41A8396D701A6734B1601F29@mail01.stbernard.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Kelly Hall <khall@stbernard.com> wrote:
 > > From: Pieter de Goeje <pieter@degoeje.nl>
 > > 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200610131728.k9DHSb2P042016>