[Top][All Lists]

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

Re: What makes set-window-buffer slow?

From: Eli Zaretskii
Subject: Re: What makes set-window-buffer slow?
Date: Sat, 25 Jun 2016 10:30:57 +0300

> Cc: address@hidden, address@hidden, address@hidden
> From: Clément Pit--Claudel <address@hidden>
> 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

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.

reply via email to

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