[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

What makes set-window-buffer slow?

From: Clément Pit--Claudel
Subject: What makes set-window-buffer slow?
Date: Thu, 23 Jun 2016 11:48:52 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0

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 
* 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 

    (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.


Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]