unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Sebastian Sturm <s.sturm@arkona-technologies.de>
To: emacs-devel@gnu.org
Subject: Re: Latency profiling?
Date: Sat, 24 Mar 2018 18:23:11 +0100	[thread overview]
Message-ID: <91053b9d-6463-e5f2-7330-497876b57e4b@arkona-technologies.de> (raw)
In-Reply-To: <CAH=MJ4ZVD7tvnXgp3qTSN8Tp2mZ81oR=ft_eh59-kFHMvj235w@mail.gmail.com>

thank you, this approach seems to work very well in combination with 
perf probe / record / script.
I'd appreciate some pointers on where to best insert user space probes 
to measure perceived input latency. I.e., which C functions are invoked 
by Emacs when it begins/finishes redisplay, and when it's ready to 
accept further user input?
Skimming over some of Emacs's source code, start_display, 
set_waiting_for_input, read_char and make_lispy_event caught my eye; am 
I on the right track here, or should I be looking at something else?

On 03/19/2018 03:01 AM, Joseph Garvin wrote:
> You could use a bash script that selects the Emacs window with wmctrl, 
> attaches perf to the Emacs PID, then loops using xdotool to emulate 
> keyboard presses while the window is visible and has focus for some 
> number of iterations, then stops perf.
> 
> On Mar 18, 2018 8:25 PM, "Stefan Monnier" <monnier@iro.umontreal.ca 
> <mailto:monnier@iro.umontreal.ca>> wrote:
> 
>      > What is the best way to emulate interactive user input and
>     reliably assess
>      > the speed with which said input is processed?
> 
>     I guess what you want is to use execute-kbd-macro in an interactive
>     Emacs session.  Tho, currently it seems that execute-kbd-macro will end
>     up short-circuiting the redisplay (normally redisplay is called when we
>     call keyboard.c:read_char, but while inside a keyboard-macro this
>     function will return the next "key" immediately without getting to the
>     redisplay call).
> 
>     I think it would be valuable to make such an execution mode available
>     (you can probably mimick it tolerably well by just adding explicit
>     (redisplay t) calls between each command).
> 
> 
>              Stefan
> 
> 
> 



      reply	other threads:[~2018-03-24 17:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-18 20:29 Latency profiling? Sebastian Sturm
2018-03-18 20:46 ` Eli Zaretskii
2018-03-19  1:25 ` Stefan Monnier
2018-03-19  2:01   ` Joseph Garvin
2018-03-24 17:23     ` Sebastian Sturm [this message]

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=91053b9d-6463-e5f2-7330-497876b57e4b@arkona-technologies.de \
    --to=s.sturm@arkona-technologies.de \
    --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).