Re: using bzip2 to compress man-pages

From: Mikhail Teterin <mi+mx_at_aldan.algebra.com>
Date: Fri, 30 Sep 2005 17:21:24 -0400
> 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
Received on Fri Sep 30 2005 - 19:21:44 UTC

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