From: Eli Zaretskii <eliz@gnu.org>
To: "Stephane Travostino" <sph@combo.cc>
Cc: luangruo@yahoo.com, 72960@debbugs.gnu.org
Subject: bug#72960: 31.0.50; PGTK Wayland exhibits more lag than X11 version
Date: Tue, 03 Sep 2024 19:01:13 +0300 [thread overview]
Message-ID: <865xrc7mly.fsf@gnu.org> (raw)
In-Reply-To: <6cd67964-40f2-4861-8625-a2a4cfab6655@app.fastmail.com> (sph@combo.cc)
> Date: Tue, 03 Sep 2024 16:36:44 +0100
> From: "Stephane Travostino" <sph@combo.cc>
> Cc: 72960@debbugs.gnu.org
>
> > Please try profiling the lagging cases with "M-x profiler", and post
> > the profile here.
>
> I don't know how to make a consistent test case. I have tried here to profile opening Emacs (same commit with and without PGTK) on the same 547-line Elixir file, and holding the Down key until it reaches the bottom and then back to the top of the buffer. I have (setopt scroll-conservatively 101) so after the first page the contents are continuously redrawn for every new line.
>
> The PGTK version feels like it's skipping frames while it's relatively smooth on X11:
>
> X11:
> 8795 86% + redisplay_internal (C function)
> 1141 11% + command-execute
> 54 0% + direnv--maybe-update-environment
> 49 0% + gcmh-register-idle-gc
> 42 0% + winner-save-old-configurations
> 20 0% + timer-event-handler
> 18 0% + ...
> 18 0% + jit-lock--antiblink-post-command
>
>
> PGTK:
> 9387 91% + redisplay_internal (C function)
> 698 6% + command-execute
> 19 0% + ...
> 19 0% + timer-event-handler
> 12 0% + direnv--maybe-update-environment
> 11 0% + winner-save-old-configurations
>
> I have run this a few times and in Wayland `redisplay_internal` takes always a few percent more time than on X11, though I am not sure these numbers can prove anything as they are quite close.
Thanks. Maybe Po Lu will have some ideas.
> Is there some kind of consistent UI benchmark I can run? The frame skipping reminds me of missed vsync deadlines one might experience in games.
Try this:
(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 function, then visit a large file, like src/xdisp.c from
the Emacs sources, and invoke "M-x scroll-up-benchmark RET". It will
show the time it took at the end. Record the results and compare with
the other configuration.
next prev parent reply other threads:[~2024-09-03 16:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-02 9:18 bug#72960: 31.0.50; PGTK Wayland exhibits more lag than X11 version Stephane Travostino
2024-09-02 12:05 ` Eli Zaretskii
2024-09-02 12:12 ` Stephane Travostino
2024-09-03 11:27 ` Stephane Travostino
2024-09-03 12:52 ` Eli Zaretskii
2024-09-03 15:36 ` Stephane Travostino
2024-09-03 16:01 ` Eli Zaretskii [this message]
2024-09-04 0:58 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-04 0:57 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=865xrc7mly.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=72960@debbugs.gnu.org \
--cc=luangruo@yahoo.com \
--cc=sph@combo.cc \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).