From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: A tip: how to display longer function names in profiler-report Date: Mon, 21 Dec 2020 16:32:21 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16495"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 21 17:34:22 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1krO8c-0004BI-2B for ged-emacs-devel@m.gmane-mx.org; Mon, 21 Dec 2020 17:34:22 +0100 Original-Received: from localhost ([::1]:47456 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1krO8b-0001PJ-3l for ged-emacs-devel@m.gmane-mx.org; Mon, 21 Dec 2020 11:34:21 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1krO6w-0000Xs-MQ for emacs-devel@gnu.org; Mon, 21 Dec 2020 11:32:38 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:57775 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.90_1) (envelope-from ) id 1krO6n-0001qx-4b for emacs-devel@gnu.org; Mon, 21 Dec 2020 11:32:38 -0500 Original-Received: (qmail 79239 invoked by uid 3782); 21 Dec 2020 16:32:21 -0000 Original-Received: from acm.muc.de (p4fe15b47.dip0.t-ipconnect.de [79.225.91.71]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Mon, 21 Dec 2020 17:32:21 +0100 Original-Received: (qmail 13783 invoked by uid 1000); 21 Dec 2020 16:32:21 -0000 Content-Disposition: inline X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.1; envelope-from=acm@muc.de; helo=mail.muc.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:261383 Archived-At: Hello, Emacs. It's annoyed me for a long time that profiler-report wastes so much horizontal screen space, and truncates function names horribly. And that's in CC Mode, which has a very short package prefix, "c-". When the functions being recorded are within jit-lock, I can easily reach a nesting depth of 25. That only leaves room for the first 23 characters of the name to be displayed. This is inadequate. The documentation of profiler.el is not good. It is composed of a large number of mainly small functions, few (if any) of which have an adequate doc string or function comment. Some configuration variables which perhaps ought to be customisable likewise have no comments or doc strings. The variable which controls the widths of the comment name, number of samples, and percentage columns is profiler-report-cpu-line-format. It's default value is: ((50 left) (24 right ((19 right) (5 right)))) , which codes column sizes of 50, 19, and 5. The 5 (for percentage) is OK. 50 (defun name) is too small. 19 (number of samples) is too big - that is broad enough to count up to 10^16 seconds, of the order of the age of the universe. So in my .emacs, I've adjusted these widths to 70, 9, and 5 with the following incantation: (eval-after-load "profiler" '(setq profiler-report-cpu-line-format '((70 left) (14 right ((9 right) (5 right)))))) . I've now stopped being so annoyed at the profiler. -- Alan Mackenzie (Nuremberg, Germany).