Subject: Re: bug#57207: 29.0.50; Fontification is slow after e7b5912b23 (Improvements to long lines handling)

From: Eli Zaretskii <[email-masked]>
Date: Tue, 16 Aug 2022 15:50:23 +0300

> From: Ihor Radchenko <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>,  [email-masked]
> Date: Tue, 16 Aug 2022 20:28:57 +0800
> 
> Gregory Heytings <[email-masked]> writes:
> 
> >> Maybe Org does something that frequently causes a window's redisplay 
> >> cycle to end prematurely, in which case the code that looks for long 
> >> lines could be called too frequently.  But in that case, your proposed 
> >> change will have the same problem, I think?
> >>
> >
> > That's possible indeed, let's see what Ihor tells us.
> 
> I'm afraid that my knowledge of Emacs redisplay is not sufficient to give
> any insight. I have no clue what "redisplay cycle end prematurely" means
> and how it can be triggered.

It means some hook arranged in that buffer changed something very
basic while the display engine was processing the window: resized
windows, scrolled the text, moved overlays, modified the values that
affect the mode line's dimensions.  Or maybe some input that affects
the display arrives too frequently for Emacs to keep up with the
changes on the screen.

In any such situation, redisplay cycle is forced to end prematurely,
and another cycle is started almost immediately.