From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Sebastian Sturm Newsgroups: gmane.emacs.devel Subject: Latency profiling? Date: Sun, 18 Mar 2018 21:29:54 +0100 Message-ID: <3b1b3837-dcb6-66c5-3387-43dba8df77c4@arkona-technologies.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1521404941 14287 195.159.176.226 (18 Mar 2018 20:29:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 18 Mar 2018 20:29:01 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 18 21:28:57 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1exevI-0003dt-Mi for ged-emacs-devel@m.gmane.org; Sun, 18 Mar 2018 21:28:56 +0100 Original-Received: from localhost ([::1]:39097 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1exexL-00070t-W4 for ged-emacs-devel@m.gmane.org; Sun, 18 Mar 2018 16:31:04 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1exewM-0006zD-Io for emacs-devel@gnu.org; Sun, 18 Mar 2018 16:30:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1exewJ-0004Db-FF for emacs-devel@gnu.org; Sun, 18 Mar 2018 16:30:02 -0400 Original-Received: from smtp-out002.kontent.com ([81.88.40.216]:44153) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1exewJ-0004BO-7a for emacs-devel@gnu.org; Sun, 18 Mar 2018 16:29:59 -0400 Original-Received: from [192.168.0.102] (unknown [82.195.74.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: arkona-technologies_de_22@smtp-out002.kontent.com) by smtp-out002.kontent.com (Postfix) with ESMTPSA id F1123C01287B8 for ; Sun, 18 Mar 2018 21:29:56 +0100 (CET) Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 81.88.40.216 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:223790 Archived-At: Hi, when trying to pinpoint latency issues with my Emacs setup, my usual modus operandi is to start the profiler, wildly pound on the keyboard and look for suspicious hotspots in the resulting profile. This is usually good enough to resolve the most annoying performance issues, but the process is not as systematic as I'd like it to be and it is difficult to quantitatively evaluate code improvements or check for performance regressions across package updates. I tried to profile elisp functions that involve a large number of editing or motion commands, but it seems to me that Emacs is smart enough to detect it's being used noninteractively (is that true?) and omits calls to many expensive eye candy functions (such as the lsp-ui/cquery sideline that displays type information on the C++ symbol at point). What is the best way to emulate interactive user input and reliably assess the speed with which said input is processed? Also, is there a way to profile not throughput, but latency (i.e. time elapsed between key press and Emacs being ready for further input)? As far as I can see, there are hooks invoked on self-insert-command, but I didn't find a hook that fires when redisplay is done. Anything that uses external tracing frameworks would also be fine in my book, as long as it runs on Linux. best, Sebastian Sturm