]> git.ipfire.org Git - thirdparty/man-pages.git/commit
bash_aliases: Optimize man_section()
authorAlejandro Colomar <alx@kernel.org>
Fri, 7 Apr 2023 20:58:30 +0000 (22:58 +0200)
committerAlejandro Colomar <alx@kernel.org>
Fri, 7 Apr 2023 22:09:47 +0000 (00:09 +0200)
commit0a9ea7be7c04973cc11a827ab2f1a1aba7361dd4
tree82e34862a291fb3bdea408e0406b98779a6359f1
parent4693ee33d15d53260c76fdceb8fc3947b27109ef
bash_aliases: Optimize man_section()

mandoc(1) renders pages much faster than groff(1), which is itself much
faster than using man(1).  This might seem irrelevant for a single page,
but this function is called in a loop in man_lsfunc() and man_lsvar(),
where this brings times down considerably.  For comparison,
`time man_lsfunc man*` took around 55 s (on my system) before this
change.  With groff(1), it would take around 14 s, and with mandoc(1)
(this patch), it takes 4 s.

Cc: Ingo Schwarze <schwarze@openbsd.org>
Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Cc: Gavin Smith <gavinsmith0123@gmail.com>
Cc: Dirk Gouders <dirk@gouders.net>
Cc: Colin Watson <cjwatson@debian.org>
Cc: Eli Zaretskii <eliz@gnu.org>
Cc: Larry McVoy <lm@mcvoy.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
scripts/bash_aliases