From owner-freebsd-current@FreeBSD.ORG Mon Aug 20 10:34:37 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2385516A41A for ; Mon, 20 Aug 2007 10:34:37 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (c220-239-20-82.belrs4.nsw.optusnet.com.au [220.239.20.82]) by mx1.freebsd.org (Postfix) with ESMTP id 7E8E613C481 for ; Mon, 20 Aug 2007 10:34:36 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by turion.vk2pj.dyndns.org (8.14.1/8.14.1) with ESMTP id l7KAYP35001880; Mon, 20 Aug 2007 20:34:25 +1000 (EST) (envelope-from peter@turion.vk2pj.dyndns.org) Received: (from peter@localhost) by turion.vk2pj.dyndns.org (8.14.1/8.14.1/Submit) id l7KAYOnd001879; Mon, 20 Aug 2007 20:34:24 +1000 (EST) (envelope-from peter) Date: Mon, 20 Aug 2007 20:34:24 +1000 From: Peter Jeremy To: Jeff Roberson Message-ID: <20070820103424.GG1164@turion.vk2pj.dyndns.org> References: <200708170939.l7H9diEk054469@lurza.secnetix.de> <20070819163934.V568@10.0.0.1> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="h31gzZEtNLTqOjlF" Content-Disposition: inline In-Reply-To: <20070819163934.V568@10.0.0.1> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.16 (2007-06-09) Cc: freebsd-current@freebsd.org Subject: Re: Why we don't use bzip2 in sysinstall/rescue? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2007 10:34:37 -0000 --h31gzZEtNLTqOjlF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2007-Aug-19 16:46:10 -0700, Jeff Roberson wro= te: >I tried this on my 1.8ghz pentium M laptop with 5.6MB of jpg data. > >I did: > >tar cvf foo.tar foo >cat foo.tar >> /dev/null >time bzip2/gzip foo.tar > >I removed and recreated the tar each time. The cat was to make sure it wa= s=20 >in cache, although it certainly was from the creation step before. > >Anyway, the results are: > >bzip2 >2.452u 0.026s 0:07.65 32.2% 92+3227k 5+43io 0pf+0w 1849c/6w > >gzip >0.539u 0.020s 0:01.75 31.4% 109+3268k 2+44io 0pf+0w 493c/3w I don't believe this is a reasonable test because: 1) You are measuring compression time, whilst it's decompression time that is relevant to installation. 2) jpeg images should not be compressible and are not representative of the type of data in a FreeBSD release. I've tried what I believe is a more reasonable benchmark on an Athlon XP-1800, running a recent 7-CURRENT using all the installation images in 6.2-RELEASE-i386-disk1.iso. I concatenated all the 6.2-RELEASE/*/*.?? parts into */*.tgz files as well as copying ports.tgz (a total of 31 files). I also decompressed each file and recompressed it into a bzip2 file. The total sizes were: */*.tbz: 237717490 */*.tgz: 281754511 Like you, I used "cat */*.t{g,b}z >/dev/null" to cache the files and use systat to verify that they were cached. Timing the gzcat and bzcat runs gives: gzcat -v */*.tgz > /dev/null 12.01s user 0.88s system 98% cpu 13.115 total gzcat -v */*.tgz > /dev/null 11.95s user 0.95s system 98% cpu 13.124 total gzcat -v */*.tgz > /dev/null 11.96s user 0.91s system 98% cpu 13.092 total bzcat -v */*.tbz > /dev/null 153.29s user 3.43s system 98% cpu 2:39.03 tot= al bzcat -v */*.tbz > /dev/null 153.32s user 3.26s system 98% cpu 2:39.14 tot= al bzcat -v */*.tbz > /dev/null 153.16s user 3.48s system 98% cpu 2:39.02 tot= al This is nearly 13:1 slower for bzcat, with a size reduction of about 15%. As for the CPU vs I/O tradeoff, I believe that gzcat will be I/O bound whilst bzcat will be CPU bound in most situations, though I haven't actually verified this. --=20 Peter Jeremy --h31gzZEtNLTqOjlF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFGyW4w/opHv/APuIcRAmReAKCfSZuBMvLC5yvHcOfX1iDw3nstPACfRKw6 Ou72FokBGz6lfivWXCrFQIQ= =9uD6 -----END PGP SIGNATURE----- --h31gzZEtNLTqOjlF--