using bzip2 to compress man-pages
Mikhail Teterin
mi+mx at aldan.algebra.com
Thu Sep 22 18:31:10 PDT 2005
> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mpsizer.diff
Type: text/x-diff
Size: 691 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20050922/433a6404/mpsizer.bin
More information about the freebsd-current
mailing list