emacs-devel
[Top][All Lists]
Advanced

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

Re: Drawing UI elements behind text


From: Eli Zaretskii
Subject: Re: Drawing UI elements behind text
Date: Thu, 28 Nov 2024 08:53:30 +0200

> Date: Wed, 27 Nov 2024 21:30:54 +0100
> Cc: emacs-devel@gnu.org
> From: Cecilio Pardo <cpardo@imayhem.com>
> 
> >> The very naive implementation I have now adds something like 5ms to each
> >> redisplay on a 1900px frame, and I hope to bring it down a lot from there.
> > 
> > What takes 5ms, exactly? what kind of redisplay did you trigger, and
> > how did you trigger it?
> 
> A minimal redisplay, just moving the cursor around. This takes less than 
> 1ms, including the time to copy the back buffer to the window.
> 
> When the segment drawing is activated (with tens of thousands of them, 
> though only tens of them visible in some window) the process takes 
> around 5ms.
> 
> This process includes:
> 
> - Making a new bitmap, and copy the result of redisplay to it.
> - Iterate trough lisp objects to prepare the segments, clip them and 
> draw them to this bitmap.
> 
> There is a lot of room here to make it faster.

OK, but I was more interested in more complex redisplay-related
scenarios.  For example, what happens if you add a few lines of text
to the bottom of the window (by yanking several lines at once)?  This
should cause Emacs to scroll the window, so that the text previously
shown at the top of the window will scroll out of the viewport, and
the yanked lines will be scrolled in.  How long does this take, with
and without these segments?

Similarly, what are the timings (again, with and without these
segments) when you just move the cursor, but in a way that it goes out
of the window, or ends up in a display margin at the top of the
window, or in a partially-visible line at the bottom of the window?

Those (and other similar ones) are the scenarios where the display
engine activates its non-trivial optimization methods, and the
questions of interest related to that are:

  . do we need to disable some of the optimizations when these
    segments are on display (because their assumptions are
    incompatible with how these segments are drawn)?
  . how do these segments affect redisplay times in each such case,
    after we disable the optimizations, if any, that are incompatible
    with them?

These questions are prerequisites for deciding whether we need to make
this particular case faster by some special measures.

Thanks.



reply via email to

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