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

From: Gregory Heytings <[email-masked]>
Date: Sun, 31 Jul 2022 23:15:56 +0000

>> That's true, but with such big files, the initial scan is slow.  So the 
>> scenario is simple: you open a big enough file, type M->, and C-p. 
>> M-> will be instantaneous, and C-p will take a while, because of 
>> syntax-ppss.
>
> Really?  I'd expect that `M->` is slow because of `syntax-ppss` (called 
> by font-lock) and then `C-p` is instantaneous.
>

Yes, really.  M-> is fast because syntax-ppss is called inside 
fontification-functions, which are evaluated in a small portion of the 
buffer (with locked narrowing).  And C-p is slow because post-command-hook 
is (or rather was) not subjected to the same locked narrowing.