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

From: Stefan Monnier <[email-masked]>
Date: Wed, 17 Aug 2022 09:20:28 -0400

>> nxml-syntax-propertize might well be heavier than average, but the delay 
>> scales linearly with the size of the file.
> Which is generally not a good scaling factor, especially if the
> coefficient is quite large (as it seems to be in this case).

For most languages, this is the minimum scaling factor that allows the
result to be correct in all cases.  So, as a general rule, it should be
considered as a good scaling factor, I think (when seen as a judgment
on the implementation quality of a major mode).

Obviously, that won't work well in really large buffers, but to a large
extent that should be blamed on the language rather than its major mode.

For this reason, we need to add hacks/heuristics (e.g. not highlighting,
accepting occasional broken highlighting, delaying highlighting,
younameit) if we want to be able to handle such large buffers in
a timely fashion.

        Stefan