Subject: Re: bug#78474: 31.0.50; Wrong char insertion in rxvt

From: Eli Zaretskii <[email-masked]>
Date: Wed, 23 Jul 2025 20:06:57 +0300

> Date: Wed, 23 Jul 2025 18:18:14 +0200
> From: Samuel Thibault <[email-masked]>
> Cc: [email-masked], [email-masked], [email-masked],
> 	[email-masked], [email-masked]
> 
> Eli Zaretskii, le mer. 23 juil. 2025 19:15:36 +0300, a ecrit:
> > > Eli Zaretskii, le mer. 23 juil. 2025 14:31:23 +0300, a ecrit:
> > > >  . benchmark the result by comparing the performance of text-mode
> > > >    display while scrolling through a large C source file
> > > 
> > > How can we measure that?
> > 
> > We have a scrolling benchmark which could be useful.  I'd start with
> > that.
> 
> How to start it / where to find it?
> 
> (I almost never use emacs)

Sorry, I wasn't aware of that.

Here's what I usually use:

(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))))))

Evaluate this in an interactive session, then visit src/xdisp.c, and
invoke the command.  Wait until it finishes scrolling and record the
time it shows.  Then run the same in the version with the patch, and
compare the times.

Note: you need to run this in a fresh Emacs session, i.e. never run
the benchmark twice in the same session.

Robert also mentioned that leaning on C-v and noticing when Emacs
display starts "stuttering", meaning it cannot keep up with the
auto-repeat rate of the keyboard, is also something useful -- provided
you can notice the percentage into the file that is shown in the mode
line when it starts to "stutter".  If it starts stuttering earlier, it
means the display code works harder.