using bzip2 to compress man-pages

Mikhail Teterin mi+mx at
Thu Sep 22 18:31:10 PDT 2005


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

and the following command:

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

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 

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 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: mpsizer.diff
Type: text/x-diff
Size: 691 bytes
Desc: not available
Url :

More information about the freebsd-current mailing list