Subject: bug#57245: 29.0.50; M-> in a large XML file (without long lines) is slow

From: Dmitry Gutov <[email-masked]>
Date: Tue, 16 Aug 2022 23:49:38 +0300

On 16.08.2022 23:22, Stefan Monnier via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:
> Dmitry Gutov [2022-08-16 22:32:23] wrote:
>> On 16.08.2022 19:54, Eli Zaretskii wrote:
>>> Stefan, can you see why syntax-related stuff in sgml-mode is so heavy
>>> here?
>> nxml-syntax-propertize might well be heavier than average, but the delay
>> scales linearly with the size of the file.
> Indeed, it should be linear.
> 
>> Which seems to be exactly the behavior the "font-lock narrowing" was
>> supposed to guard from?
> Not sure which narrowing you're referring to.
> The "locked narrowing" introduced by Gregory is only installed in the
> presence of long lines.  It's (currently) not used for large files
> (unless they contain long lines, that is).

I guess that's the problem here.

The font-lock narrowing (if it's indeed the method we're going to use to 
speed up its performance) shouldn't be conditioned on the presence of 
long lines.