From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#61779: 30.0.50; excessive redisplay when the mini window is active Date: Sat, 25 Feb 2023 17:37:14 +0800 Message-ID: <87v8jq2iid.fsf@yahoo.com> References: <878rgm46d6.fsf.ref@yahoo.com> <878rgm46d6.fsf@yahoo.com> <83ilfqkv1o.fsf@gnu.org> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29699"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 61779@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 25 10:40:14 2023 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 1pVr2L-0007cC-Uc for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Feb 2023 10:40:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVr2C-0002Sa-8L; Sat, 25 Feb 2023 04:40:04 -0500 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 1pVr2A-0002Q5-Ot for bug-gnu-emacs@gnu.org; Sat, 25 Feb 2023 04:40:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVr2A-0004Ly-Dr for bug-gnu-emacs@gnu.org; Sat, 25 Feb 2023 04:40:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pVr2A-0006g9-9U for bug-gnu-emacs@gnu.org; Sat, 25 Feb 2023 04:40:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Feb 2023 09:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61779 X-GNU-PR-Package: emacs Original-Received: via spool by 61779-submit@debbugs.gnu.org id=B61779.167731798925649 (code B ref 61779); Sat, 25 Feb 2023 09:40:02 +0000 Original-Received: (at 61779) by debbugs.gnu.org; 25 Feb 2023 09:39:49 +0000 Original-Received: from localhost ([127.0.0.1]:39042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVr1w-0006fc-RO for submit@debbugs.gnu.org; Sat, 25 Feb 2023 04:39:49 -0500 Original-Received: from sonic305-47.consmr.mail.ne1.yahoo.com ([66.163.185.173]:44410) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVr1u-0006fN-Dm for 61779@debbugs.gnu.org; Sat, 25 Feb 2023 04:39:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1677317979; bh=M/wV1r4OgM+u4xHyj0nwq2kcojl5icP424f+zoC3KbY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=cUr/fhUc54yoAzc/jagNwh2ucuJ8/QOouuAI2cthHFgp+8yTY3tXp3hbuxLRGiGEDDSIyHJEiO3S+qQt7Zf2fFjWc9e4e1yy1iR2jNG4oH5ohKUNPu1kC0i73M0IZV6dr8m+8lZecfgf/a+QSN5SFZ1YfL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6x2OZ co.kf81YNTLlctw5gl5O_lbU973xrf4RduQiOvnKyfSmktl6M_ecz9Lm5y.g5MXcGbRqmOca5948 NfjKOofJVjKcAitRE_Z9C3M4hT5oXK7FmRegMUwHaRttEa3xajlzEuruk340YD6QbUAhG2BOgZRO FFpY3A18OrvtYDWS56taEwyTi.47gD1JHMunK.rujNiA0SxInyUIl8Uox8WANlv_EvqMpUcAioRH gdw3q.IHjV4x.dq2PEX45OvRamRZnYO2LwvpGj1J7b0ayXdBfbO4cgWn9ERYdaFaeqKhYnCoGQCS s42rUxN7WIDJmpQpFaAjv2VnY4uPVX8K6LTYwWmPY6yc5Bm0DekXN7IE3PA_mb8Zhz5yquHMJAsa W03KaqjxTyc23XnY1P7te0gqot3CMQiruySbRaCmdxp71tCnCjKj67t_fHmuSBkywhk0z.Lmfso7 XRn1ThbH09XPVVPI4nkJBFWU9.9MO8Hhbr4UeeiUyh X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.ne1.yahoo.com with HTTP; Sat, 25 Feb 2023 09:39:39 +0000 Original-Received: by hermes--production-sg3-9fc5746c8-7wpmf (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 2fbedf61b1cff97a3f1766fd44301b4e; Sat, 25 Feb 2023 09:37:36 +0000 (UTC) In-Reply-To: <83ilfqkv1o.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 25 Feb 2023 10:29:07 +0200") X-Mailer: WebService/1.1.21221 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo 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:256704 Archived-At: Eli Zaretskii writes: >> Date: Sat, 25 Feb 2023 14:16:37 +0800 >> From: Po Lu via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> For some reason redisplay_internal will always update the mini window >> even if its buffer contents have not changed. I guess there is probably >> a missing optimization wrt to updating the echo area contents, and >> window_outdated does not take the echo area message into account: >> >> && (CHARPOS (tlbufpos) == ZV >> || FETCH_BYTE (BYTEPOS (tlbufpos)) == '\n')) >> /* Former continuation line has disappeared by becoming empty. */ >> goto cancel; >> else if (window_outdated (w) || MINI_WINDOW_P (w)) <============== >> { >> /* We have to handle the case of continuation around a >> wide-column character (see the comment in indent.c around >> line 1340). >> >> I am not sure that is why, however, so I can't just change that. >> Anyway, update_window_line does not draw anything since the contents of >> the glyph row do not change after redisplay, so that part is fine. The >> problem is that the redisplay will lead to update_window being called, >> and gui_update_window_end will always call display_and_set_cursor >> afterwards to display the cursor, which is not okay, as it generates a >> lot of X protocol traffic when redisplay is called and redisplays the >> mini-window. Now add to that a process generating a lot of output, and >> by doing so, calls to redisplay_preserve_echo_area, and you have an >> absurd number of X requests, enough to saturate any reasonable network >> connection. >> >> Here is a patch to resolve the problem by not redrawing the cursor when >> Emacs knows it is already there. I've not seen any ill effects so far, >> but the comment originally there seems to know better, so what are the >> cases where ``phys_cursor_on_p is 1 but the cursor has been erased''? > > This is okay for master, thanks. The comment that was there still makes me uncomfortable, so: > Btw, the code which tests MINI_WINDOW_P here: > >> && (CHARPOS (tlbufpos) == ZV >> || FETCH_BYTE (BYTEPOS (tlbufpos)) == '\n')) >> /* Former continuation line has disappeared by becoming empty. */ >> goto cancel; >> else if (window_outdated (w) || MINI_WINDOW_P (w)) <============== >> { >> /* We have to handle the case of continuation around a >> wide-column character (see the comment in indent.c around >> line 1340). > > is very old, dating back to the initial revision of xdisp.c before the > Emacs 21 display engine changes, so maybe we should try removing that > instead (assuming that it is related to the more general change > regarding the cursor you want to install). I guess that's the better idea, since it's the only reasonable way I found to make update_window be called extremely often without any changes actually happening.