unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Clément Pit--Claudel" <clement.pit@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: acm@muc.de, emacs-devel@gnu.org, schwab@suse.de
Subject: Re: What makes set-window-buffer slow?
Date: Fri, 24 Jun 2016 10:19:12 -0400	[thread overview]
Message-ID: <576D4160.90201@gmail.com> (raw)
In-Reply-To: <83shw21yhs.fsf@gnu.org>


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

On 2016-06-24 09:56, Eli Zaretskii wrote:
> Looks like redisplay is indeed an important factor here.
> 
> In addition, it looks like you have some subprocess from which you
> read input?  What's the part of profile below about?
> 
>   - scomint-output-filter                                           173  26%
>    - run-hook-with-args                                             173  26%
>     - proof-shell-filter-wrapper                                    169  26%
>      - byte-code                                                    169  26%
>       - proof-shell-filter                                          160  24%
>        - proof-shell-filter-manage-output                           137  21%
> 	- proof-shell-exec-loop                                     123  19%
> 	 - mapc                                                      95  14%
> 	  - proof-shell-invoke-callback                              93  14%
> 	   - byte-code                                               93  14%
> 	    - proof-done-advancing                                   93  14%
> 
> Can you write some high-level overview of what the inner loop of your
> code does, including what is being redisplayed, and how input from
> subprocesses enters the picture?

This is in the context of a package called proof general. It's an interface for proof assistants. Essentially you write a sequence of commands, and ask the proof assistant to process them one by one.

The proof-shell functions do this: they handle communication with the subprocess. The main loop looks like this:

* Fetch one command from the buffer
* Send it to the subprocess
* When a response arrives, call a hook
* Send the next command

My code adds a functioon into that hook that calls set-window-buffer; when I remove that call, everything is snappy. When I add it back in, everything gets much slower (at least that's what I understand; this isn't happening on my machine).

> In addition, I suggest to run your benchmark several times, so as to
> eliminate the significant portion of time execute-extended-command and
> its subroutines, and the profiler itself, show in the profile?  Also,
> load all the Lisp libraries as *.el files, so that the profile is more
> detailed.

OK, I'll ask the person who's seeing that bug to generate this report.

Thanks for your help!
Clément.


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

  reply	other threads:[~2016-06-24 14:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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=576D4160.90201@gmail.com \
    --to=clement.pit@gmail.com \
    --cc=acm@muc.de \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=schwab@suse.de \
    /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).