GNU bug report logs -
#76504
31.0.50; Excessive redisplay when display-line-numbers-mode is enabled
Previous Next
Reported by: Davide Masserut <dm <at> mssdvd.com>
Date: Sun, 23 Feb 2025 15:29:02 UTC
Severity: minor
Found in version 31.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> Date: Sun, 23 Feb 2025 16:27:50 +0100
> From: Davide Masserut via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>
> To reproduce:
> - Open a file with many lines
> - Enable display-line-numbers-mode
> - Hold down C-n
>
> On my T480s (i5-8350U) in power-saving mode, this results in choppy cursor
> movement.
Using line-numbers is a bit more expensive than without them, so on
machines with weak CPUs it could cross the line between redisplay
being able to keep up and not being able to keep up with your keyboard
auto-repeat rate (which will cause choppy redisplay).
What is your keyboard auto-repeat rate on that system?
> The built-in profiler shows that moving the cursor down through my
> 1200-row init file results in 25,174 redisplays when
> display-line-numbers-mode is enabled, compared to 2,193 when it is
> disabled.
Is that a cpu profile or a "memory" profile? You should use the
former.
I've used the cpu profiler to scroll through 1700 lines of a large
file, and I indeed see that with display-line-numbers-mode turned on
there are more calls to redisplay_internal, but not by factor as large
as 12 that you see. I see about 4 times more calls to
redisplay_internal.
Anyway, why is the number of calls to redisplay_internal an issue?
Emacs calls redisplay_internal when it's idle, so the number of calls
does not necessarily say anything of importance.
This bug report was last modified 70 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.