From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#72960: 31.0.50; PGTK Wayland exhibits more lag than X11 version Date: Tue, 03 Sep 2024 19:01:13 +0300 Message-ID: <865xrc7mly.fsf@gnu.org> References: <4086d678-7a60-4b87-8c73-c5c9939f05e8@app.fastmail.com> <86mskq8dlm.fsf@gnu.org> <6985778c-712c-48ff-be6d-d5c8cbfd30f5@app.fastmail.com> <86ikvc7vcr.fsf@gnu.org> <6cd67964-40f2-4861-8625-a2a4cfab6655@app.fastmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30541"; mail-complaints-to="usenet@ciao.gmane.io" Cc: luangruo@yahoo.com, 72960@debbugs.gnu.org To: "Stephane Travostino" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 03 18:04:26 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1slW13-0007mY-UF for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 03 Sep 2024 18:04:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1slW0s-00034v-5w; Tue, 03 Sep 2024 12:04:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slW0p-00034g-KN for bug-gnu-emacs@gnu.org; Tue, 03 Sep 2024 12:04:12 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1slW0e-00020w-6s for bug-gnu-emacs@gnu.org; Tue, 03 Sep 2024 12:04:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=G2IKsLZIrcztUAMNo9xGjhl44gsxHWWWX4o8D3fLmjQ=; b=g8Q42M/seByxASREXiKJrZqxO+fcP0QhrUTg3Jww9X5FmeTQ4h5x4tmmgoDmnAz7pJ7GJWZUiLw4zgSNPvZDm/U1byNo+BBRRCcZnpVkgArWEmgpHrlDM9D6AYHy5mDpk+WRVrBKecF6pZnlNxb66aNJo3n5TM0mkjUSoKF+7mXZxk8Y2720lPZn8a+iLRTAj0PP1DBmgNP7OQi1NiHinJ4gx51zKGCvDxwqmOpth889AYu0TUVGKMwVz08Z2c+tSnOQYQUq3288m5u75DO29Cak02caXJ1ykwhaZSbSfYRxzSM77NMFZ4elWwA7uGa/kXVvEfjv2Q3VszpnbDdPNA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1slW1e-0000Q0-7m for bug-gnu-emacs@gnu.org; Tue, 03 Sep 2024 12:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 Sep 2024 16:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72960 X-GNU-PR-Package: emacs Original-Received: via spool by 72960-submit@debbugs.gnu.org id=B72960.17253794811577 (code B ref 72960); Tue, 03 Sep 2024 16:05:02 +0000 Original-Received: (at 72960) by debbugs.gnu.org; 3 Sep 2024 16:04:41 +0000 Original-Received: from localhost ([127.0.0.1]:60627 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slW1I-0000PM-Pn for submit@debbugs.gnu.org; Tue, 03 Sep 2024 12:04:41 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:35592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slW1F-0000P3-0r for 72960@debbugs.gnu.org; Tue, 03 Sep 2024 12:04:39 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slVy2-0001mm-9g; Tue, 03 Sep 2024 12:01:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=G2IKsLZIrcztUAMNo9xGjhl44gsxHWWWX4o8D3fLmjQ=; b=rHBjIwOOuhC8 FcE4hm3jtmGSzZE+P6LUeA7/9/R0SYEoQhP5JZXfJlpzIPcVM6lBiqyqOLqc97byePGPEcKOLSC0j q9huhFDBNotsSRHudst5jEP5BtzTqFhVZjb/5GoM8GU4jd8XRw8rYMYpV46f2UGeim0FjwRBi1pNv Bx5EZPYMlFaBXy74JXKhxoV5nt4Y2+WtTZlOttF2YSl5f8wUmGOXa4A1+on9OB6EYa7GT7rZ4OIQQ q7QnUYG9roHO04zzTd+5VF1F2sBPkWX/bYhlrK58dYFag7uJx0hZM1MTnMtWiY5jM6ByZgk0dDJrm +4TB0nndzrQQz+paCzzfFA==; In-Reply-To: <6cd67964-40f2-4861-8625-a2a4cfab6655@app.fastmail.com> (sph@combo.cc) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:291155 Archived-At: > Date: Tue, 03 Sep 2024 16:36:44 +0100 > From: "Stephane Travostino" > 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.