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" 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