GNU bug report logs -
#63364
(man "gcc") very slow
Previous Next
Full log
View this message in rfc822 format
> Date: Mon, 8 May 2023 10:15:33 +0200
> From: Tobias Bading <tbading <at> web.de>
>
> With emacs-29 branch 7133784303 or master 31a66dc891:
>
> 1. emacs -Q
>
> 2. M-x man RET gcc RET
>
> Emacs 29 and 30 both need almost 30 seconds to fully display this man page
> on my machine (18714 lines, gcc-9, 2021-06-01). Emacs 26.3 needs about 2
> seconds. (All tests done after “sudo cpupower frequency-set --max 3.5GHz”.)
>
> According to “perf top -g”, rpl_re_search_2 and re_match_2_internal are
> heavily involved.
I think this is the price of fixing bugs with fontification/cleanup of
the man pages, which we installed in Emacs 27; see bug#36927. Since
the text of the man page is received from the background formatter in
chunks of arbitrary size, we cannot fontify/cleanup each chunk
separately, because that will miss some patterns we want to process.
So whenever a chunk is received, we always go to the beginning of the
section, and start fontifying from there. And the GCC man page
basically has one huge OPTIONS section and very little else. So each
time we receive one more chunk, we go back to the beginning of OPTIONS
and restart anew.
If someone has ideas for how to go back to a closer place without
missing some roff markup that got divided between chunks, patches are
welcome. OTOH, we don't really want to encourage use of man pages...
This bug report was last modified 1 year and 285 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.