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

Mike Meyer mwm-keyword-freebsdhackers2.e313df at mired.org
Tue Oct 10 12:59:59 PDT 2006

In <200610101727.k9AHRrYo039774 at lurza.secnetix.de>, Oliver Fromme <olli at lurza.secnetix.de> typed:
> Is that a known problem?  Is someone working on it?

Not necessarily a known problem, but not a surprise. I'm not sure
about the size issue - it's not clear what compression level it's
running at. The real time difference is expected. tar uses libarchive,
which does the compression in the process. So while piping tar's
output to gzip will let gzip compress data while tar is waiting on
disk I/O, having tar compress things for you means that doesn't
happen. Fixing that is a non-trivial task.

Since they use different code - with different licenses - some
difference is expected.

Mike Meyer <mwm at mired.org>		http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.

More information about the freebsd-hackers mailing list