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

From: Dmitry Gutov <[email-masked]>
Date: Fri, 5 Aug 2022 15:59:57 +0300

On 01.08.2022 14:58, Eli Zaretskii wrote:

> As I wrote elsewhere, I'm okay with extending 'widen' so that it could
> "unlock" the locked narrowing, which could then be used in major modes
> that convince us their performance is adequate (or clearly announce in
> their docs that they don't care about files with long lines ;-).

And to address the idea of "unlocking" the narrowing: I think I have 
demonstrated that the remaining slowdown can be caused purely by the 
length of the buffer and how long 'parse-partial-sexp' takes to parse 
it. That part doesn't have much to do with individual modes.

And of course the more, let's say, *complex* modes like CC Mode will opt 
for unlocking narrowing right away because its font-lock logic has to 
jump around to previously-saved positions in its syntax cache, which 
will inevitably spam errors here and there when those positions are not 
accessible.