From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 11 09:34:18 2006 Return-Path: X-Original-To: freebsd-hackers@FreeBSD.ORG Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5E8BD16A40F for ; Wed, 11 Oct 2006 09:34:18 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id AB0E143D76 for ; Wed, 11 Oct 2006 09:34:17 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (czgzuv@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id k9B9YAN0081295 for ; Wed, 11 Oct 2006 11:34:15 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id k9B9YASW081294; Wed, 11 Oct 2006 11:34:10 +0200 (CEST) (envelope-from olli) Date: Wed, 11 Oct 2006 11:34:10 +0200 (CEST) Message-Id: <200610110934.k9B9YASW081294@lurza.secnetix.de> From: Oliver Fromme To: freebsd-hackers@FreeBSD.ORG In-Reply-To: <17707.64434.913943.549852@bhuda.mired.org> X-Newsgroups: list.freebsd-hackers User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (FreeBSD/4.11-STABLE (i386)) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Wed, 11 Oct 2006 11:34:16 +0200 (CEST) X-Mailman-Approved-At: Wed, 11 Oct 2006 12:20:42 +0000 Cc: Subject: Re: "tar -c|gzip" faster than "tar -cz"?!? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-hackers@FreeBSD.ORG List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2006 09:34:18 -0000 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