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.