From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: What makes set-window-buffer slow? Date: Sat, 25 Jun 2016 10:30:57 +0300 Message-ID: <83fus1209a.fsf@gnu.org> References: <576C04E4.9040000@gmail.com> <576C2054.3020705@gmail.com> <20160623181242.GB4946@acm.fritz.box> <576C2AAA.1090707@gmail.com> <83fus33ekr.fsf@gnu.org> <576C536A.6060503@gmail.com> <83bn2r2i0y.fsf@gnu.org> <576D2895.4020600@gmail.com> <83shw21yhs.fsf@gnu.org> <576D4160.90201@gmail.com> <83oa6q1jua.fsf@gnu.org> <576DA723.1000603@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1466839918 5982 80.91.229.3 (25 Jun 2016 07:31:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 25 Jun 2016 07:31:58 +0000 (UTC) Cc: acm@muc.de, emacs-devel@gnu.org, schwab@suse.de To: =?windows-1252?Q?Cl=E9ment?= Pit--Claudel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 25 09:31:54 2016 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 1bGi4F-0003DF-RM for ged-emacs-devel@m.gmane.org; Sat, 25 Jun 2016 09:31:51 +0200 Original-Received: from localhost ([::1]:48871 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGi4E-0003V9-Tg for ged-emacs-devel@m.gmane.org; Sat, 25 Jun 2016 03:31:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGi49-0003V3-OK for emacs-devel@gnu.org; Sat, 25 Jun 2016 03:31:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGi46-0007R3-JP for emacs-devel@gnu.org; Sat, 25 Jun 2016 03:31:45 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46589) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGi46-0007Qu-G2; Sat, 25 Jun 2016 03:31:42 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4565 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bGi44-0001a8-Ba; Sat, 25 Jun 2016 03:31:40 -0400 In-reply-to: <576DA723.1000603@gmail.com> (message from =?windows-1252?Q?C?= =?windows-1252?Q?l=E9ment?= Pit--Claudel on Fri, 24 Jun 2016 17:33:23 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:204750 Archived-At: > Cc: acm@muc.de, schwab@suse.de, emacs-devel@gnu.org > From: Clément Pit--Claudel > Date: Fri, 24 Jun 2016 17:33:23 -0400 > > When started, Proof General splits the screen in two: > > | | | > | | | > | User's file | Message log | > | | | > | | | > > Each time a message is received, it's displayed in the Message log window. > My extension sometimes reuses that window for other things (for example, to show company-mode's documentation buffer). > The set-window-buffer call is there to ensure that the user sees new messages. Of course in most cases that call is useless: that's why predicating it on the window not already displaying the message log makes things faster. Does the WINDOW argument of set-window-buffer name the selected window at the time of the call? If not, set-window-buffer will cause all the other windows to be redisplayed, so arranging for WINDOW to be the selected window might speed up things. Another potential speedup might be had if you invoke set-window-buffer with its KEEP-MARGINS argument non-nil. Alternatively, try changing your hook to use its own window for whatever you want to show, leaving the "Message Log" window alone. I'm puzzled how come redisplay was called so many times (2400) in this scenario. Is such a large number reasonable? How many seconds did it take to run the scenario? > > Also, how come it doesn't happen on your machine? Are any > > customizations involved? Is your OS different from that of the other > > user? > > Somewhat unclear. The OS are the same (Linux mint), and the problem does happen in emacs -Q for the other user. The version of Emacs is the same. How about local vs remote invocation, and/or the X configuration in general? Also, what about toolkits and Cairo -- did both builds use the same optional features in this department? Finally, if the user can try a later Emacs, it might help, because some non-trivial redisplay optimizations were done since 24.4.