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

From: Dmitry Gutov <[email-masked]>
Date: Sat, 13 Aug 2022 19:59:27 +0300

On 13.08.2022 16:42, Gregory Heytings wrote:
> 
>>
>> I think we'll want to decouple the two because they aren't quite the 
>> same (e.g. in many cases the time taken by `syntax-ppss` doesn't 
>> depend on the length of lines, whereas the time taken by 
>> `font-lock-keywords` rues does not depend on the total buffer size).
>>
> 
> That's what I initially thought, too.  Now I tend to think that it would 
> be better to not decouple these two cases, because it would be too 
> expensive to distinguish the four possible cases, namely:

I'm fairly sure that my branch demonstrates that there's nothing 
expensive about it.

It's just one commit, 20 additions, 10 deletions. It should take 2 
minutes max to read and understand it.

Yes, it adds a new custom var (for readability's sake we could split it 
in two later). But that's only logical since it handles an orthogonal 
problem to the one that long-line-threshold is about.