Re: using bzip2 to compress man-pages

From: Mikhail Teterin <mi+mx_at_aldan.algebra.com>
Date: Thu, 22 Sep 2005 21:30:17 -0400
> http://www.pkix.net/~chuck/manpage_test/

Interesting. I did not realize, bzip2 is inferior to gzip on small files. It 
still wins overall, however -- the wins on large man-pages compensate for 
losses on the small ones. Your script does not show the total number of 
sectors in each case (patch attached).

Using your

	http://www.pkix.net/~chuck/manpage_test/manpage.txt

and the following command:

	awk 'NF == 2 {
		p=$2; gz=$1; gzsectors=int((gz-1)/512)+1;
		tgzsectors+=gzsectors
	} NF == 1 {
		bz=$1;	bzsectors=int((bz-1)/512)+1;
		tbzsectors+=bzsectors;
		print p ":\t" gz " " gzsectors " " tgzsectors \
		    " " bz " " bzsectors " " tbzsectors
	} END {
		print tgzsectors " of .gz can be turned into " \
		    tbzsectors " of .bz2"}'
	    /tmp/manpage.txt

I get:

	14919 of .gz can be turned into 14738 of .bz2

That's 181 512-byte sectors or 92672 bytes. Not very much, but this is just 
the /usr/share/man. Considering the /usr/share/cat (with larger _formatted_ 
files), plus the ports' man-pages, I still think bzip2 is beneficial.

Assuming 1024-sized sectors, I get 8170 for .gz vs. 8067 for .bz2, or 105472 
bytes.

Reducing reliance on GNU software remains an extra bonus...

Finally, the PR contains independent patches for both man(1) and the man-page 
compressing infrastructure. After 5-months wait, I'll settle for partial 
acceptance.

Yours,

	-mi

Received on Thu Sep 22 2005 - 23:31:10 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:44 UTC