From: Alejandro Colomar Date: Fri, 7 Apr 2023 20:58:30 +0000 (+0200) Subject: bash_aliases: Optimize man_section() X-Git-Tag: man-pages-6.05-a1~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0a9ea7be7c04973cc11a827ab2f1a1aba7361dd4;p=thirdparty%2Fman-pages.git 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 Cc: "G. Branden Robinson" Cc: Gavin Smith Cc: Dirk Gouders Cc: Colin Watson Cc: Eli Zaretskii Cc: Larry McVoy Signed-off-by: Alejandro Colomar --- diff --git a/scripts/bash_aliases b/scripts/bash_aliases index 9f7d104093..5c0458402e 100644 --- a/scripts/bash_aliases +++ b/scripts/bash_aliases @@ -65,7 +65,8 @@ man_section() -e "/^\.SH $s/p" \ -e "/^\.SH $s/,/^\.SH/{/^\.SH/!p}"; done;) \ - |man -P cat -l - 2>/dev/null; + |mandoc -Tutf8 2>/dev/null \ + |col -pbx; done; }