Subject: bug#59530: 29.0.50; Fontification hangs with C header file

From: Alan Mackenzie <[email-masked]>
Date: Sat, 26 Nov 2022 14:11:28 +0000

Hello, Eli.

On Sat, Nov 26, 2022 at 13:02:38 +0200, Eli Zaretskii wrote:
> > From: Sujith Manoharan <[email-masked]>
> > Date: Thu, 24 Nov 2022 09:32:03 +0530

> > 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.

> Alan, did you see this bug report?

I hadn't, no, but I think it's already been fixed by the following
commit:

commit 3208a42c47c4f98cb03c4b15164ca83113244b40
Author: Alan Mackenzie <[email-masked]>
Date:   Thu Nov 24 10:51:03 2022 +0000

    CC Mode: Make it scroll fast over buffers with only #define's

The OP's test file was around 6 MB big.  When I scrolled all the way
through it, it took around 32 seconds.

I'll look into this more carefully, and get in touch with the OP.

Thanks!

-- 
Alan Mackenzie (Nuremberg, Germany).