all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: "Clément Pit-Claudel" <cpitclaudel@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: A tip: how to display longer function names in profiler-report
Date: Mon, 21 Dec 2020 21:24:52 +0000	[thread overview]
Message-ID: <X+ESpAFdj2wS6oMi@ACM> (raw)
In-Reply-To: <c74de8a3-68ca-eb05-eeb4-2eba4e31e05d@gmail.com>

Hello, Clément.

On Mon, Dec 21, 2020 at 15:24:06 -0500, Clément Pit-Claudel wrote:
> On 12/21/20 11:32 AM, Alan Mackenzie wrote:
> > 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-".

> I think the best fix would be to put the CPU samples and % columns
> first instead of last, and put the function name column last, with no
> limits on how far to the right it might expand.

That's an utterly brilliant idea!  Thanks!

Something like, very roughly: ....



diff --git a/lisp/profiler.el b/lisp/profiler.el
index bf8aacccc3..20486da29b 100644
--- a/lisp/profiler.el
+++ b/lisp/profiler.el
@@ -445,9 +445,10 @@ profiler-report-leaf-mark
   :group 'profiler)
 
 (defvar profiler-report-cpu-line-format
-  '((50 left)
-    (24 right ((19 right)
-	       (5 right)))))
+  '((24 right ((19 right)
+	       (5 right)))
+    (90 left))
+                           )
 
 (defvar profiler-report-memory-line-format
   '((55 left)
@@ -505,13 +512,14 @@ profiler-report-line-format
     (profiler-format (cl-ecase (profiler-profile-type profiler-report-profile)
 		       (cpu profiler-report-cpu-line-format)
 		       (memory profiler-report-memory-line-format))
-		     name-part
 		     (if diff-p
 			 (list (if (> count 0)
 				   (format "+%s" count)
 				 count)
 			       "")
-		       (list count count-percent)))))
+		       (list count count-percent))
+                     name-part
+                                                  )))
 
 (defun profiler-report-insert-calltree (tree)
   (let ((line (profiler-report-line-format tree)))
@@ -735,7 +748,8 @@ profiler-report-describe-entry
 	    (cpu
 	     (profiler-report-header-line-format
 	      profiler-report-cpu-line-format
-	      "Function" (list "CPU samples" "%")))
+	      (list "CPU samples" "%") "Function"
+                                                 ))
 	    (memory
 	     (profiler-report-header-line-format
 	      profiler-report-memory-line-format


-- 
Alan Mackenzie (Nuremberg, Germany).



  reply	other threads:[~2020-12-21 21:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-21 16:32 A tip: how to display longer function names in profiler-report Alan Mackenzie
2020-12-21 17:15 ` Eli Zaretskii
2020-12-21 17:34   ` Alan Mackenzie
2020-12-21 18:12     ` Eli Zaretskii
2020-12-21 18:52       ` Alan Mackenzie
2020-12-21 17:52 ` Stefan Kangas
2020-12-21 18:14   ` Alan Mackenzie
2020-12-21 20:24 ` Clément Pit-Claudel
2020-12-21 21:24   ` Alan Mackenzie [this message]
2020-12-21 21:34     ` Clément Pit-Claudel
2020-12-21 22:09       ` Alan Mackenzie
2020-12-22 12:22       ` Alan Mackenzie

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=X+ESpAFdj2wS6oMi@ACM \
    --to=acm@muc.de \
    --cc=cpitclaudel@gmail.com \
    --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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.