From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 5c9304e: Disable some display optimizations when frames need redisplay Date: Fri, 02 Oct 2015 21:05:13 -0400 Message-ID: References: <20150930193450.11644.62040@vcs.savannah.gnu.org> <831tdd75i3.fsf@gnu.org> <83eghd5ff2.fsf@gnu.org> <83vbap3qxb.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1443834356 15461 80.91.229.3 (3 Oct 2015 01:05:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 3 Oct 2015 01:05:56 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 03 03:05:47 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZiBGl-0000qi-28 for ged-emacs-devel@m.gmane.org; Sat, 03 Oct 2015 03:05:47 +0200 Original-Received: from localhost ([::1]:36335 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZiBGk-0000yN-6U for ged-emacs-devel@m.gmane.org; Fri, 02 Oct 2015 21:05:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56252) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZiBGN-0000yD-8H for emacs-devel@gnu.org; Fri, 02 Oct 2015 21:05:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZiBGK-00051b-4w for emacs-devel@gnu.org; Fri, 02 Oct 2015 21:05:21 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:36717) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZiBGF-0004zJ-Df; Fri, 02 Oct 2015 21:05:15 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CYDQA731xV/wihxEVcgxCEAshgBAICgTw8EQEBAQEBAQGBCkEFg10BAQMBJy8WCgMFCws0EhQYDSSINwjPIwEBAQEGAQEBAR6LOoUFB4QtAQSzP4FFI4IKHBWBWSKCeAEBAQ X-IPAS-Result: A0CYDQA731xV/wihxEVcgxCEAshgBAICgTw8EQEBAQEBAQGBCkEFg10BAQMBJy8WCgMFCws0EhQYDSSINwjPIwEBAQEGAQEBAR6LOoUFB4QtAQSzP4FFI4IKHBWBWSKCeAEBAQ X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="167103921" Original-Received: from 69-196-161-8.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([69.196.161.8]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Oct 2015 21:05:13 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 50B14AE07B; Fri, 2 Oct 2015 21:05:13 -0400 (EDT) In-Reply-To: <83vbap3qxb.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 03 Oct 2015 00:24:00 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:190756 Archived-At: >> So, the value 2 (aka REDISPLAY_SOME) already gives you the information >> that "only frames F1 and F2 need to be redisplayed". > But you need to examine the frame's 'redisplay' flag anyway. Which frame(s)? If windows_or_buffers_changed is 0, you shouldn't need to examine any frame's `redisplay' flag, AFAIK. > So that special value of windows_or_buffers_changed just adds > management (you need to reset it, and it can acquire higher values > depending on what redisplay_internal discovers), without adding any > value. I'm not sure how much there is to gain from removing it, since it's also used for wset_redisplay and bset_redisplay. But it sounds like you have a plan. > The loop over all frames checking whether any have the 'redisplay' > flag set is fast, so there's no need for a global flag to convey that. Indeed, such a loop is cheap. But as long as windows_or_buffers_changed is used for the wset_redisplay and bset_redisplay, I don't see much benefit in removing it from fset_redisplay. But of course, looping over all windows is also fairly cheap, so I guess you're planning to remove it also from wset_redisplay and bset_redisplay? >> 100% agreement, and that's why I introduced those `redisplay' bits and >> the corresponding REDISPLAY_SOME value for windows_or_buffers_changed. >> >> And AFAIK it already has the effect that when we call fset_redisplay only >> those frames get redisplayed. > Maybe so, but the effect of this on frames is completely undocumented, I tried to document it in those var's comment: /* Nonzero if we should redraw the mode lines on the next redisplay. If it has value REDISPLAY_SOME, then only redisplay the mode lines where the `redisplay' bit has been set. Otherwise, redisplay all mode lines (the number used is then only used to track down the cause for this full-redisplay). */ int update_mode_lines; /* Nonzero if window sizes or contents other than selected-window have changed since last redisplay that finished. If it has value REDISPLAY_SOME, then only redisplay the windows where the `redisplay' bit has been set. Otherwise, redisplay all windows (the number used is then only used to track down the cause for this full-redisplay). */ int windows_or_buffers_changed; I see it's not very specific about frame/window/buffer's `redisplay' flag, tho. >> Also rather than "don't set windows_or_buffers_changed in >> fset_redisplay", it seems like it would be safer to try and eliminate >> (one by one) the places where we check the value of >> windows_or_buffers_changed instead of checking f->redisplay or something >> like that. > You cannot eliminate windows_or_buffers_changed without replacing them > with something. I lost you here. I thought you're suggesting to get rid of this variable. I'm only suggesting to remove (step by step) some of those places where we check its value and I'm not suggesting to remove them without replacing them with something, but rather I suggest to replace those checks by checks of things like f->redisplay. Stefan