Subject: 29.0.50; Fontification hangs with C header file
From: Sujith Manoharan <[email-masked]>
To: [email-masked]
Date: Thu, 24 Nov 2022 09:32:03 +0530
List-Id: <debbugs-submit.debbugs.gnu.org>

Opening this header file with lots of macros makes Emacs
very slow.

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/amd/include/asic_reg/dce/dce_12_0_sh_mask.h

Same behavior is seen with other header files inside asic_reg.
Fontification/scrolling hangs Emacs and it becomes unusable.

Bug #25706 suggested the workaround 'fast-but-imprecise-scrolling',
but enabling it doesn't seem to improve things now.

In GNU Emacs 29.0.50 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.17.6, Xaw scroll bars) of 2022-11-24 built on comp-lnx
Repository revision: b37604c263e4813dc2a8b80e4e9131a3961c4f3e
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101004
System Description: Arch Linux

Configured using:
 'configure --prefix=/usr/local --enable-link-time-optimization
 --without-libsystemd --with-x-toolkit=lucid --without-dbus
 --without-gsettings --without-selinux --with-native-compilation
 --with-imagemagick 'CFLAGS=-O2 -march=native''

Configured features:
ACL CAIRO FREETYPE GIF GLIB GMP GNUTLS GPM HARFBUZZ IMAGEMAGICK JPEG
JSON LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG
SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP
X11 XDBE XIM XINPUT2 XPM LUCID ZLIB

Important settings:
  value of $LANG: en_IN.UTF-8
  locale-coding-system: utf-8-unix

Major mode: ELisp/d

Minor modes in effect:
  global-pg-break-lines-mode: t
  page-break-lines-mode: t
  save-place-mode: t
  savehist-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  column-number-mode: 1
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow face-remap mu4e mu4e-org org ob ob-tangle ob-ref ob-lob ob-table
ob-exp org-macro org-footnote org-src ob-comint org-pcomplete pcomplete
org-list org-faces org-entities noutline outline org-version
ob-emacs-lisp ob-core ob-eval org-table oc-basic bibtex ol org-keys oc
org-compat advice org-macs org-loaddefs format-spec find-func mu4e-main
mu4e-view thingatpt comint ansi-osc cal-menu calendar cal-loaddefs
mu4e-headers mu4e-compose mu4e-draft mu4e-actions smtpmail mu4e-search
mu4e-lists mu4e-bookmarks mu4e-mark mu4e-message hl-line mu4e-contacts
mu4e-update mu4e-folders mu4e-server mu4e-context mu4e-obsolete
mu4e-vars mu4e-helpers mu4e-config bookmark pp emacsbug diff-mode
gnus-fun misearch multi-isearch mule-util qp sort smiley ansi-color
gnus-cite flow-fill mail-extr textsec uni-scripts idna-mapping
ucs-normalize uni-confusable textsec-check gnus-async gnus-bcklg
gnus-agent gnus-srvr gnus-score score-mode nnvirtual nntp gnus-ml
gnus-msg nndoc gnus-cache gnus-dup gnus-art mm-uu mml2015 mm-view
mml-smime smime dig gnus-sum shr pixel-fill kinsoku url-file svg dom
gnus-group gnus-undo gnus-start gnus-dbus dbus gnus-cloud nnimap nnmail
mail-source utf7 nnoo parse-time iso8601 gnus-spec gnus-int gnus-range
gnus-win gnus nnheader range wid-edit mm-archive message sendmail
yank-media rfc822 mml mml-sec epa derived epg rfc6068 epg-config
gnus-util text-property-search time-date mailabbrev gmm-utils mailheader
mail-utils gnutls network-stream url-cache display-line-numbers
debbugs-gnu add-log debbugs-compat debbugs soap-client mm-decode
mm-bodies mm-encode url-http url-auth mail-parse rfc2231 rfc2047 rfc2045
mm-util ietf-drums mail-prsvr url-gw nsm puny rng-xsd rng-dt rng-util
xsd-regexp xml xcscope ring ido dired-x dired dired-loaddefs disp-table
easy-mmode page-break-lines cycbuf saveplace savehist comp comp-cstr
warnings icons rx cl-extra help-mode vlf-autoloads cycbuf-autoloads
emms-autoloads page-break-lines-autoloads w3m-load w3m-autoloads
nov-autoloads esxml-autoloads elisp-benchmarks-autoloads kv-autoloads
markdown-mode-autoloads visual-fill-column-autoloads info
debbugs-autoloads package browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie generate-lisp-file
url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv
bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip
cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd
fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow
isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads inotify lcms2 dynamic-setting
font-render-setting cairo x-toolkit xinput2 x multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 500168 20588)
 (symbols 48 25070 7)
 (strings 32 111874 5151)
 (string-bytes 1 3139956)
 (vectors 16 72444)
 (vector-slots 8 1167524 27317)
 (floats 8 733 134)
 (intervals 56 3981 360)
 (buffers 992 23))