Subject: bug#76504: 31.0.50; Excessive redisplay when display-line-numbers-mode is enabled

From: Eli Zaretskii <[email-masked]>
Date: Sun, 23 Feb 2025 20:42:16 +0200

> From: Davide Masserut <[email-masked]>
> Date: Sun, 23 Feb 2025 18:45:49 +0100
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > What is your keyboard auto-repeat rate on that system?
> 
> 50 character per second, but I just did the same test with auto-repeat
> set at 25 c/s and got the same results (21,480 / 1,875 = 11.456).
> 
> However, the difference in behaviour is much smaller, as you probably
> expected.
> [...]
> The same test with auto-repeat set to 50 c/s and the balanced power
> profile results in a 4.6 factor (10,053 / 2,165).

With 50 or with 25 c/s?

> > Anyway, what's important is the time it takes to scroll through a file
> > with and without line numbers.  So please try the command below and
> > post the times it reports after scrolling through some large file with
> > and without the line numbers:
> >
> > (defun scroll-up-benchmark ()
> >   (interactive)
> >   (let ((oldgc gcs-done)
> >         (oldtime (float-time)))
> >     (condition-case nil (while t (scroll-up) (redisplay))
> >       (error (message "GCs: %d Elapsed time: %f seconds"
> >                       (- gcs-done oldgc) (- (float-time) oldtime))))))
> 
> xdisp.c power-saver
> GCs: 492 Elapsed time: 55.600977 seconds
> GCs: 493 Elapsed time: 55.490811 seconds
> 
> xdisp.c power-saver line numbers
> GCs: 488 Elapsed time: 66.925708 seconds
> GCs: 495 Elapsed time: 66.195398 seconds
> 
> xdisp.c balanced
> GCs: 491 Elapsed time: 26.969390 seconds
> GCs: 492 Elapsed time: 27.098322 seconds
> 
> xdisp.c balanced line numbers
> GCs: 494 Elapsed time: 32.596467 seconds
> GCs: 494 Elapsed time: 32.593883 seconds

This is what I expect to see: line-number display slows down redisplay
by about 10% to 20%.

I see no bug here.