From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: What makes set-window-buffer slow? Date: Sat, 25 Jun 2016 10:07:11 -0400 Message-ID: <576E900F.5070004@gmail.com> 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> <83fus1209a.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3UxFAjIj3WRKeWkE4uComWveICR1frGhk" X-Trace: ger.gmane.org 1466863688 13384 80.91.229.3 (25 Jun 2016 14:08:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 25 Jun 2016 14:08:08 +0000 (UTC) Cc: acm@muc.de, emacs-devel@gnu.org, schwab@suse.de To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 25 16:07:59 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 1bGoFW-0006nJ-My for ged-emacs-devel@m.gmane.org; Sat, 25 Jun 2016 16:07:54 +0200 Original-Received: from localhost ([::1]:50104 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGoFV-0000yk-LJ for ged-emacs-devel@m.gmane.org; Sat, 25 Jun 2016 10:07:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35580) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGoEz-0000yd-Md for emacs-devel@gnu.org; Sat, 25 Jun 2016 10:07:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGoEv-0006uV-Dq for emacs-devel@gnu.org; Sat, 25 Jun 2016 10:07:20 -0400 Original-Received: from mout.kundenserver.de ([212.227.126.130]:55398) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGoEv-0006uR-2O; Sat, 25 Jun 2016 10:07:17 -0400 Original-Received: from [18.189.1.110] ([18.189.1.110]) by mrelayeu.kundenserver.de (mreue005) with ESMTPSA (Nemesis) id 0MM2cS-1bHuAP3du8-007pCj; Sat, 25 Jun 2016 16:07:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 In-Reply-To: <83fus1209a.fsf@gnu.org> X-Provags-ID: V03:K0:uytsjwMV4we2yvrWYRtDYRdeXflFFWfUrQISNN5N5ACrTEDtjHY PKt8Ud7AQdVm9qEg89Xhxv3NZ1SmHJtI9FrfVtVLGzDBgf4ntytvjL6/KtSmEA2HaGrhUcK 1cI+xzWAj7Ww2mulyD1Ra+3HyG5wC4+BdnckiYntoilI8P7y/OA5uAoLD73U+fQ8lMHC7Pr I+0wECxy/7ifJnwSKhNIg== X-UI-Out-Filterresults: notjunk:1;V01:K0:8ATr86SHeeE=:OEyp4Q/PMEBiyFnGttcrCY ZfauMDU72t4HnqcaChbi0cte1ZSu13aAh4XGcplaBVBS2NmsWbJVfgVsmYWP7/r+RBL5W4RCz 3NCs05JDnksJ5SBX6k3Vqzr17xNXWQh1Mxk+pGJ3U3zQCuAf/RPpaEz9To76yQ8vzGM882y2J 75kmExSr+BeEdXrKDHGa++uasb5OEbeKtiQXS6oAQeYCOmuh8o1pwHqHD1++qB7CrVZve+BUG AsvE6zoEyoMGYVw99bcv//oXgiW8MtH0eM6YE2lv3iNpOJvYMSQJdMQCadC2Jy/ben1JYa6Ak OWpoJeqo4SKHrgZNfGb1bevMCo1BFPKy5Ql8riEoWIqOOzegHc1v701MQYTfQqVoGwGhlg38/ kT+xABtAMcEMtji/9Mb5wtUNy4NSTMsmbS1asPH8HoeG+8l4cnR6OEtJnBB1+kFX0x7g07Q1T WoD8AZ36uCgPGYqLZOvUIqvtbuF7iPDVNkj6MywP2Iz9Es2mJkSlMmthqiBY6zl+uwH9kxmbp nxdoVKlbnmxzySv4+3Bk9wRSYQBhP9qpXqi8qk0NzyHd7yz1AboiMvGEfbbsCrhBsWBNmyP8j h4YoENYgpdYZcXmCJcRbqK6eK7JoBd7TwpsCDw0aPg+7HKLYOymsEY0jisvVxCPSWTok78BAA tdGnqU7HG2mHf7E77e9FASUEmettozq6uhcVs+v3ATKTuimnOmL/TV7HXusYXroR0b2M= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.130 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:204757 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --3UxFAjIj3WRKeWkE4uComWveICR1frGhk Content-Type: multipart/mixed; boundary="u8IuxAiCxtuoCoaVUNJ6mWUfST5wmVteB" From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= To: Eli Zaretskii Cc: acm@muc.de, schwab@suse.de, emacs-devel@gnu.org Message-ID: <576E900F.5070004@gmail.com> Subject: Re: What makes set-window-buffer slow? 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> <83fus1209a.fsf@gnu.org> In-Reply-To: <83fus1209a.fsf@gnu.org> --u8IuxAiCxtuoCoaVUNJ6mWUfST5wmVteB Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2016-06-25 03:30, Eli Zaretskii wrote: >> Cc: acm@muc.de, schwab@suse.de, emacs-devel@gnu.org >> From: Cl=E9ment 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 win= dow. >> My extension sometimes reuses that window for other things (for exampl= e, to show company-mode's documentation buffer). >> The set-window-buffer call is there to ensure that the user sees new m= essages. Of course in most cases that call is useless: that's why predica= ting it on the window not already displaying the message log makes things= faster. >=20 > 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. The window was indeed not selected at the time of the call. Would a simpl= e with-selected-window around the call do it? If so, could set-window-buf= fer just do that? Btw, do you think there is any issue with just not call= ing set-window-buffer if the window already contains that buffer? > Another potential speedup might be had if you invoke set-window-buffer > with its KEEP-MARGINS argument non-nil. Interesting, thanks! That wouldn't prevent the scrollbar's length from be= ing adjusted to the length of the newly displayed buffer, right? > Alternatively, try changing your hook to use its own window for > whatever you want to show, leaving the "Message Log" window alone. I don't think that's possible, unfortunately :/ > 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? 5 to 8 minutes, I think. (Btw, maybe the profiler could record this timin= g information? >>> 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 do= es happen in emacs -Q for the other user. The version of Emacs is the sam= e. >=20 > How about local vs remote invocation, and/or the X configuration in > general? I think local invocation in both cases. Mate desktop vs. Cinnamon. Would = it be useful for me to profile the same code on my own machine? Maybe com= paring the profiles would help. > Also, what about toolkits and Cairo -- did both builds use the same > optional features in this department? I think so; I use the default build setting, plus a patch to revert a com= mit that makes Emacs unusable for me since April 2014. > Finally, if the user can try a later Emacs, it might help, because > some non-trivial redisplay optimizations were done since 24.4. Ok, I'll keep this in mind; I don't think that will happen for them until= Debian updates, though. And in any case, I don't even have this problem = on 24.4... Cl=E9ment. --u8IuxAiCxtuoCoaVUNJ6mWUfST5wmVteB-- --3UxFAjIj3WRKeWkE4uComWveICR1frGhk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJXbpAPAAoJEPqg+cTm90wjDr8QALxxU/75f6iORGuRoPyeV22l XZxvuIO6TZsSC84kxaLZEhkVAna9DK1wlE2yHrSs6FxK969hVdrITM7OspBgTaue ZxHZzeHI72Fumw153yX72QkPQhnnrF/mv5sbzoHCQvZW17JV61YTjR9IOdQ/g79c MorAeSCRrBZR30cBFjFKa2kUY2XJ/FQO7NXg0u5x0HB5ljCEOqle+/D1Ayf84TtB MY9eySma8sOba2MT9VmgWBRqWGENbRjeUmSXExt8gjzVbpVQOOHXYR85iGJX0YZj KV0RI92yfw8Fx+4GjXe+TmDVxjget8HoaMy6g86EfRcyGMsnzgcLd+VnOuS213JR mdtufPor2kOGlav/RvSPg2fmo8Kl4pmz8C692gEP2ge+qQMBp8wSg/EkNGlxqB5s arVFlOEGB9nI/uZ4VFQJIgkS/Jawy2F9BPHuTXenPq++vUJRVHACVFm/xHdRyFV/ +ohOIImWLSihU48WVGPikkQkElmgrISmfFwqao0/Cxa/1s/0x+Or46cq0XSomauw 3hSIPMHjIaoqaLlShMZJFtahITjYBxpKRBFTX2q9WcxGJNrgZ6sHheAYkrtE+SA2 B2PJ3q4u0zten/2fUP2VkVX1i1lCuWkt+zoW564RaMVcyrPe2TvcNmH/mzmTqAXQ uiipX38CpmQvekrHsIWG =/D3v -----END PGP SIGNATURE----- --3UxFAjIj3WRKeWkE4uComWveICR1frGhk--