GNU bug report logs - #78766
100-4000x redisplay slowdown with vscroll>0 and make-cursor-line-fully-visible=t

Previous Next

Package: emacs;

Reported by: JD Smith <jdtsmith <at> gmail.com>

Date: Wed, 11 Jun 2025 23:09:02 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: JD Smith <jdtsmith <at> gmail.com>
Cc: 78766 <at> debbugs.gnu.org
Subject: bug#78766: 100-4000x redisplay slowdown with vscroll>0 and make-cursor-line-fully-visible=t
Date: Tue, 17 Jun 2025 14:30:58 +0300
> From: JD Smith <jdtsmith <at> gmail.com>
> Date: Mon, 16 Jun 2025 17:40:46 -0400
> Cc: 78766 <at> debbugs.gnu.org
> 
> >> Seems to work normally with line-move and tall images.  I will run with it for a while to see if anything else appears.
> > 
> > If that works for you, it's fine by me.  I thought that recentering
> > will effectively disable the effect of vscroll, and so assumed it will
> > be unacceptable for your package.
> 
> Your instincts were good.  The patch was fine in almost all scenarios, but had problems for images taller than the window.  In this situation you have no choice but to keep point on a partially visible top line.  The inherent recentering negatively affects line-move across tall images, especially noticeable for multiple tall lines in a row.
> 
> If we use your top row test as enclosed, this seems to do what we want: avoid the long loop and resulting big slowdown, while permitting the cursor to fall on a partially visible top line.
> 
> Thanks for your efforts.

You are welcome, but now I'm not sure I understand what you are
saying.  Are you saying that the patch you sent, viz.:

> diff --git a/src/xdisp.c b/src/xdisp.c
> index 1106edb6caf..dd726397352 100644
> --- a/src/xdisp.c
> +++ b/src/xdisp.c
> @@ -19218,9 +19218,11 @@ try_scrolling (Lisp_Object window, bool just_this_one_p,
>        if (! cursor_row_fully_visible_p (w, extra_scroll_margin_lines <= 1,
>  					false, false)
>  	  /* It's possible that the cursor is on the first line of the
> -	     buffer, which is partially obscured due to a vscroll
> -	     (Bug#7537).  In that case, avoid looping forever. */
> -	  && extra_scroll_margin_lines < w->desired_matrix->nrows - 1)
> +	     buffer, which is partially obscured due to vscroll
> +	     (Bug#7537).  In that case, just return, since the code
> +	     above is not prepared to deal with that case. */
> +	  && ! (MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P
> +		(w, MATRIX_ROW (w->desired_matrix, w->cursor.vpos))))
>  	{
>  	  clear_glyph_matrix (w->desired_matrix);
>  	  ++extra_scroll_margin_lines;

Fixes the problem for you and doesn't have any adverse effects, so I
can install it?




This bug report was last modified 31 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.