"tar -c|gzip" faster than "tar -cz"?!?

Kelly Hall khall at stbernard.com
Fri Oct 13 09:56:50 PDT 2006


> From: Pieter de Goeje <pieter at 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.  Maybe the rest of you figured this out immediately, but it took my
coffee a while to take effect ;)

Kelly


More information about the freebsd-hackers mailing list