[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tick Reduction

From: Stefan Monnier
Subject: Re: Tick Reduction
Date: Fri, 19 Nov 2021 14:24:46 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

> That is only true when the window is redisplayed in its entirety, top
> to bottom.  This happens relatively rarely, because the display engine
> tries very hard not to redisplay much more than absolutely necessary.
> These redisplay optimizations are generally structure as follows:
>  . find the beginning and the end of the part of the buffer that needs
>    to be redisplayed
>  . redisplay that part starting at its beginning and going to its end
> This could result in redisplaying just one line, for example, or all
> lines between N and M.  Which means that redisplay of a window can
> start at some arbitrary point in the middle of the window, without
> knowing anything about the preceding lines, except that they weren't
> changed on the glass.

IIUC this isn't quite true: the "old" glyph matrix still contains the
rendering result of the previous lines and while it's old, it's still
up-to-date, so we might be able to extract the alignment info we need
from that.

>> so I think we could handle the case of "align
>> with some previous line" (with some non-trivial caveats since it means
>> that future changes in that previous line would need to cause POS to be
>> re-processed, which may require disabling some optimizations).
> What you want would require every redisplay to always redraw the
> entire window.  IOW, disable _all_ redisplay optimizations.

Not necessarily always: we could record dependencies between lines of
the glyph matrix such that we only grow the set of redisplayed lines
when it's actually needed (i.e. when the corresponding text does use
such cross-line alignment).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]