unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Clément Pit--Claudel" <clement.pit@gmail.com>
To: Emacs developers <emacs-devel@gnu.org>
Subject: What makes set-window-buffer slow?
Date: Thu, 23 Jun 2016 11:48:52 -0400	[thread overview]
Message-ID: <576C04E4.9040000@gmail.com> (raw)


[-- 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 --]

             reply	other threads:[~2016-06-23 15:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-23 15:48 Clément Pit--Claudel [this message]
2016-06-23 16:01 ` What makes set-window-buffer slow? 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=576C04E4.9040000@gmail.com \
    --to=clement.pit@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).