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

From: Stefan Monnier <[email-masked]>
Date: Sun, 31 Jul 2022 19:00:11 -0400

> But one big slow scan (and how slow it is actually depends on a particular
> major mode)

Indeed, I think the `syntax-ppss` part itself should be fast enough even
if very large files.  But the `syntax-propertize` part (which is called
by `syntax-ppss`) can take a long time in some major modes.

In those major modes where that's a problem (i.e. major modes that have
a complex `syntax-propertize-function` and that also happen to be used
in very large files) maybe it would be worth (re)introducing some sort
of `syntax(-propertize)-begin-function`.  But these kinds of heuristics
have proved problematic over the years (and they'd introduce extra
complexity since we won't be able to just rely on
a `syntax-propertize-done` high-watermark to know what's been
propertized and what hasn't, combined with the interaction with the
`syntax-ppss` cache), so we'd have to try a few different approaches.

In any case this is not a long-lines problem.

        Stefan