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

From: Eli Zaretskii <[email-masked]>
Date: Sun, 14 Aug 2022 08:36:31 +0300

> Date: Sat, 13 Aug 2022 22:19:26 +0300
> Cc: [email-masked], Eli Zaretskii <[email-masked]>,
>  [email-masked]
> From: Dmitry Gutov <[email-masked]>
> 
> > Buffers with long lines are rare enough.  It wouldn't make sense (and 
> > would be a nightmare in terms of long term maintenance) to add 25 
> > defcustoms to allow anyone to fine-tune what Emacs does in such buffers.
> 
> I have regularly encountered redisplay slowdown caused by long lines in 
> my work. One doesn't need to have a 18 MB files to see them.
> 
> Having a 5000-10000 character line is enough to see redisplay starting 
> to stutter. And, of course, there's nothing font-lock related in those 
> stutters.

Stuttering in redisplay (and I think you actually mean stuttering in
cursor motion commands, but let's ignore that difference for now) is a
known issue, but it is NOT the goal of this effort.  The goal of this
effort is to avoid making Emacs _completely_unusable_ due to the need
to wait for many seconds for commands to complete and their results to
be shown on display.  Stuttering, while somewhat annoying, doesn't
make Emacs unusable.

So if you are talking about the cases of stuttering, you are focused
on cases that are of no particular interest to us here.  Of course,
any improvement in those other cases will also be welcome, but it is
not directly related to what we are trying to do here, and may or may
not solve the cases that are of interest to us.