Hello Helge, Tobias,

On Thu, Dec 25, 2025 at 06:07:57AM +0000, Helge Kreutzmann wrote:
> Hello Tobias,
> if you look at mansect(1), the example given does not work in Debian.
> I reported this upstream and got the following reply:
> 
> > The issue is that Debian compresses manual pages.  Please consider
> > changing the policy to not compress manual pages.  The storage savings
> > are irrelevant in this age.
> 
> Could you consider this?

Thanks!

Indeed, compressed manual pages are a pain to work with.  You can't use
regular Unix tools to work with them.  With uncompressed manual pages,
You can go to /usr/share/man, and run a pipe of programs to do a complex
search.  With tools like zgrep(1) and zcat(1), you can do some stuff,
but not everything.

A couple of years ago, I did some measurements, which should be relevant
now:
<https://lore.kernel.org/linux-man/[email protected]/T/#m272e6ee8939d0836999dd8bb28f2e0e94f48dfc7>

I'll paste some of it:

        $ sudo make install-man prefix=/opt/local/man/gz__1 -j 
LINK_PAGES=symlink Z=.gz  GZIPFLAGS=-1  | wc -l
        2571
        $ sudo make install-man prefix=/opt/local/man/gz__9 -j 
LINK_PAGES=symlink Z=.gz  GZIPFLAGS=-9  | wc -l
        2571
        $ sudo make install-man prefix=/opt/local/man/man__ -j 
LINK_PAGES=symlink Z=                   | wc -l
        2571

        $ du -sh /opt/local/man/*
        5.7M    /opt/local/man/gz__1
        5.5M    /opt/local/man/gz__9
        5.5M    /opt/local/man/gz___
        9.4M    /opt/local/man/man__

        $ export MANPATH=/opt/local/man/gz__1/share/man
        $ /bin/time -f %e dash -c "man -Kaw RLIMIT_NOFILE | wc -l | xargs 
printf '%s; '"
        17; 0.21
        $ /bin/time -f %e dash -c "find $MANPATH -type f | while read f; do 
gzip -d - <\$f | grep -l RLIMIT_NOFILE >/dev/null && echo \$f; done | wc -l | 
xargs printf '%s; '"
        17; 1.16

        $ export MANPATH=/opt/local/man/gz__9/share/man
        $ /bin/time -f %e dash -c "man -Kaw RLIMIT_NOFILE | wc -l | xargs 
printf '%s; '"
        17; 0.20
        $ /bin/time -f %e dash -c "find $MANPATH -type f | while read f; do 
gzip -d - <\$f | grep -l RLIMIT_NOFILE >/dev/null && echo \$f; done | wc -l | 
xargs printf '%s; '"
        17; 1.17

        $ export MANPATH=/opt/local/man/man__/share/man
        $ /bin/time -f %e dash -c "man -Kaw RLIMIT_NOFILE | wc -l | xargs 
printf '%s; '"
        17; 0.55
        $ /bin/time -f %e dash -c "find $MANPATH -type f | xargs -P0 grep -l 
RLIMIT_NOFILE | wc -l | xargs printf '%s; '"
        17; 0.01

As you can see, running a pipeline directly in $MANPATH is orders of
magnitude faster with uncompressed pages.  And doing global apropos is
still in the same order of magnitude, even if a bit slower (I suspect it
is actually running zgrep(1) on uncompressed pages, so it probably could
be faster).

Also, if man-db's man(1) could eventually remove the optimizations done
for gzip, we'd get a much simpler (safer) librarian program suite.

> Less preferred would be a Debian patch to the man pages, stating what
> a Debian user would have to do to achieve the purpose of mansect(1).

Indeed.


Have a lovely day!
Alex

-- 
<https://www.alejandro-colomar.es>

Attachment: signature.asc
Description: PGP signature

Reply via email to