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

From: Eli Zaretskii <[email-masked]>
Date: Wed, 27 Jul 2022 05:33:27 +0300

> Cc: [email-masked], [email-masked]
> Date: Tue, 26 Jul 2022 20:46:24 +0300
> From: Eli Zaretskii <[email-masked]>
> 
> At this point, I think the only way to produce reasonable performance
> from C-s in this case is to turn off lazy-highlighting when lines are
> truncated and the buffer has long lines.  Which means we need to
> expose the value of long_line_optimizations_p to Lisp, via an accessor
> function.  I already have one other use for this: "C-x =", which
> attempts to report the column of the character, something that is very
> slow in a long-and-truncated line.  And I think we will see more cases
> where Lisp code needs to know about this in order to adapt itself to
> long lines.

Actually, I might have one more idea that could perhaps resolve this
more nicely.

Gerd, the search for display properties and overlays in
forward_to_next_line_start, which disables the 'reseat' shortcut, is
because these could have strings as values, and those strings could
have embedded newlines, right?  Or are there some other reasons?