On Wed, 12 Sep 2007, Roland Mainz wrote:

> Al Hopper wrote:
>> On Wed, 12 Sep 2007, Roland Mainz wrote:
>>> Casper.Dik at Sun.COM wrote:
>>>>> Test case:  watch "iostat -xnzc 5" while reading from an
>>>>> optical media, using different block sizes:
>>>>>
>>>>> dd if=/dev/rdsk/c2t1d0p0 of=/dev/null bs=2k
>>>>> dd if=/dev/rdsk/c2t1d0p0 of=/dev/null bs=32k
>>>>>
>>>>> This SONY DVD RW AW-G170A (and a DVD-RW media)
>>>>> is reading ~3 MB/sec using 2k read requests, and ~8 MB/sec
>>>>> when using 32k reads.
>>>>
>>>> While this matters some, the current install process is so inefficient
>>>> that even though installing from DVD is slower than the network, a network
>>>> tends to be idle most of the time during the install.
>>>>
>>>> (Which isn't surprising as getting 4GB over local net should not take more
>>>> than between 40 (Gbps) and 400s (100Mbps) but installs take generally a lot
>>>> longer than 7 minutes; bunzip2 is also so slow that it cannot stream data
>>>> from any media faster than papertape.
>>>
>>> "bunzip" could be made a bit faster with some simple tricks (like using
>>> higher optimizer options for the compiler, use largepages for the
>>> buffers etc.) ... but it would need a sponsor for such a patch
>>
>> Optimizing bunzip is not worth the time/effort IMHO.
>
> Why ? It's just flipping a few switches at compiler level...

As good a developer are you are Roland, even you are not going to be 
able to make up the (ten to one) difference between using bunzip2 and 
gunzip by flipping a few compiler switches.  For example (from update 
4 picked at random):

[ looking at /b72/Solaris_11/Product/SUNWkuxft/archive/none.bz2 ]

# cd /tmp
# ptime bunzip2 -v none.bz2

real        6.354
user        6.164
sys         0.170

another run (file cached):
# ptime bunzip2 none.bz2

real        6.355
user        6.178
sys         0.148

Now gzip -9 the file and test gunzip:

# ptime gunzip none.gz

real        0.649
user        0.523
sys         0.124

# ptime gunzip none.gz

real        0.642
user        0.521
sys         0.120

The difference in the file sizes:

36107167 none.bz2
33391686 none.gz


>> Because it's a
>> CPU resource hog and only provides a couple of percentage points
>> reduction in the compressed file size compared to gzip.  By far a
>> better solution is to ship .gz install files.
>>
>> The original decision to ship .bz2 install files was flawed IMHO.
>
> Erm, I have to disagree... "bzip2" is in some cases _far_ better than
> "gzip" - it depends what needs to be compressed... and the extra space
> saved allows to squish more stuff on the CDs/DVDs ...

Doubtless there are some corner cases where using bzip2 would be 
worthwhile, and it may be the only option when you need every byte 
available on a CD-ROM, but for the majority of use cases gzip is a 
clear win.

Regards,

Al Hopper  Logical Approach Inc, Plano, TX.  al at logical-approach.com
            Voice: 972.379.2133 Fax: 972.379.2134  Timezone: US CDT
OpenSolaris Governing Board (OGB) Member - Apr 2005 to Mar 2007
http://www.opensolaris.org/os/community/ogb/ogb_2005-2007/

Reply via email to