Subject: bug#56682: Fix the long lines font locking related slowdowns

From: Gregory Heytings <[email-masked]>
Date: Fri, 05 Aug 2022 08:21:30 +0000

>
> If my guess is right, the fix on master whammied all over the redisplay 
> with narrowing, both fixing the "cause" and restricting font-lock to the 
> same narrowed region.
>

No, as Eli told you the restriction around font-lock was added after the 
other fixes, when it became clear that fontification-functions were the 
main remaining cause of the remaining slowdowns.

>
> - dictionary.json (18M) seems to be fontified correctly as well now 
> (it's a mess by default on master), its scrolling performance is 
> unaffected too. The difference: I have to wait ~2 seconds the first time 
> I press 'M->'.
>

You have to wait 2 seconds.  I have to wait 4, and Eli has to wait 8. 
And for someone else, with older hardware, it might be 20.  And you'll see 
similar slowdowns when you modify the buffer at one place and move 
somewhere else.  This is hardly acceptable for a still relatively small 
file, if the only reason of that additional wait it to put colors on the 
buffer characters.

>
> BTW, 'M-> M-<' triggers some puzzling long wait (~3 seconds) both on 
> master and with my change, every time I issue this sequence of commands.
>

This is caused by show-paren-mode.