"tar -c|gzip" faster than "tar -cz"?!?
Oliver Fromme
olli at lurza.secnetix.de
Wed Oct 11 02:34:18 PDT 2006
Mike Meyer wrote:
> 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.
There was no disk I/O involved in my tests. All data was
cached in RAM. You can also see from the my numbers that
the "user time" was almost the same as the "real time".
> Since they use different code - with different licenses - some
> difference is expected.
Different code? tar/libarchive uses libz, and I thought
that gzip also uses libz, but I could be wrong.
If gzip uses its own code instead of libz, that would
explain the results of my test, of course. So it seems
that gzip is 30% faster than libz ... quite significant,
I think.
It seems I won't use tar's z option anymore. :-)
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.
"To this day, many C programmers believe that 'strong typing'
just means pounding extra hard on the keyboard."
-- Peter van der Linden
More information about the freebsd-hackers
mailing list