From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 13 17:28:47 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 550E216A407 for ; Fri, 13 Oct 2006 17:28:47 +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 1325C43D68 for ; Fri, 13 Oct 2006 17:28:44 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (hevuhu@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id k9DHSbg9042017 for ; Fri, 13 Oct 2006 19:28:42 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id k9DHSb2P042016; Fri, 13 Oct 2006 19:28:37 +0200 (CEST) (envelope-from olli) Date: Fri, 13 Oct 2006 19:28:37 +0200 (CEST) Message-Id: <200610131728.k9DHSb2P042016@lurza.secnetix.de> From: Oliver Fromme To: freebsd-hackers@FreeBSD.ORG In-Reply-To: <00C5463E8A5F7C41A8396D701A6734B1601F29@mail01.stbernard.com> 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]); Fri, 13 Oct 2006 19:28:42 +0200 (CEST) X-Mailman-Approved-At: Fri, 13 Oct 2006 18:29:56 +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: Fri, 13 Oct 2006 17:28:47 -0000 Kelly Hall wrote: > > From: Pieter de Goeje > > 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