using bzip2 to compress man-pages

Mikhail Teterin mi+mx at aldan.algebra.com
Fri Sep 30 14:21:44 PDT 2005


> sectors are irrelevant.  what you need to look at is the block size,
> which is 16k by default.

Ok, thanks.

> % find /usr/share/man/ -name \*.gz -ls | sort -k 1 | awk '$1 == inode {
> next } \ { inode=$1; total++; if ($7 % 16384 < $7*0.10) savings++ } \
>  END {print savings " out of " total}'
> 6 out of 2788

Using Charles' more precise mpsizer.py (with 16384 instead of 512), I get 7 
out of 2708 -- and that is for the man* parts only (not cat), or 7*16kb=112Kb 
of savings. Not much by today's standards, but still a benefit, IMHO. Cat* 
stuff is only bigger, BTW.

But this brings up another idea -- if the actual uncompressed man-page is less 
than the destination's FS block size, there is no point compressing it at 
all...

Maybe, INSTALL_MAN should become more than an alias to install(1) and handle 
this sort of logic -- do not compress at all, gzip, or bzip2 -- depending on 
the file and FS at hand? (Yes, this assumes the blocksize of /usr/obj is the 
same as /usr, but the same ssumption is being made about /etc -- the 
destination of termcap.db).

Whatever the case, the first step would be to smarten up man(1) anyway. Looks 
like David is on the case already.

	http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/79607

	-mi


More information about the freebsd-current mailing list