unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* What makes set-window-buffer slow?
@ 2016-06-23 15:48 Clément Pit--Claudel
  2016-06-23 16:01 ` Andreas Schwab
  0 siblings, 1 reply; 18+ messages in thread
From: Clément Pit--Claudel @ 2016-06-23 15:48 UTC (permalink / raw)
  To: Emacs developers


[-- Attachment #1.1: Type: text/plain, Size: 1168 bytes --]

Hi emacs-devel,

This is a rather ill-defined question. I've just been through a round of 20 emails with a user, trying to understand which part of one of my packages made Proof General horribly slow. We progressively narrowed it down to this:

    (set-window-buffer win buf)

... which is definitely not what I expected. Note that:

* This happens in emacs -Q with just Proof General loaded
* The two hooks that set-window-buffer calls are nil (window-hscroll-functions and window-configuration-change-hook)
* This is called about 200 times (once for each full message received from a subprocess).
* Commenting out this line makes processing of these ~200 messages from the subprocess take 5 seconds instead of 50.

The (most) surprising part here is that the following change makes it fast again:

    (unless (eq (window-buffer win) buf)
       (set-window-buffer win buf))

IOW, in most cases, the window in question already displays buf; yet, the calls are extremely slow.

Is anyone familiar with such an issue? This is in GNU Emacs 24.4.1; I can't reproduce it myself, but I can ask for more information if needed.

Cheers,
Clément.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2016-06-25 14:39 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-23 15:48 What makes set-window-buffer slow? Clément Pit--Claudel
2016-06-23 16:01 ` Andreas Schwab
2016-06-23 17:45   ` Clément Pit--Claudel
2016-06-23 18:12     ` Alan Mackenzie
2016-06-23 18:30       ` Clément Pit--Claudel
2016-06-23 19:11         ` Eli Zaretskii
2016-06-23 21:23           ` Clément Pit--Claudel
2016-06-24  6:54             ` Eli Zaretskii
2016-06-24 12:33               ` Clément Pit--Claudel
2016-06-24 13:56                 ` Eli Zaretskii
2016-06-24 14:19                   ` Clément Pit--Claudel
2016-06-24 18:31                     ` Clément Pit--Claudel
2016-06-24 19:13                     ` Eli Zaretskii
2016-06-24 21:33                       ` Clément Pit--Claudel
2016-06-25  7:30                         ` Eli Zaretskii
2016-06-25 14:07                           ` Clément Pit--Claudel
2016-06-25 14:27                             ` Eli Zaretskii
2016-06-25 14:39                               ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).