zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.dk
Subject: PATCH: Re: misalignment in zprof output
Date: Tue, 20 Mar 2001 10:34:42 +0100 (MET)	[thread overview]
Message-ID: <200103200934.KAA07070@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Adam Spiers's message of Mon, 19 Mar 2001 22:25:21 +0000


Adam Spiers wrote:

> Just started to fiddle with zprof with the intent of spotting any
> bottlenecks in my zsh startup (initial experiments show promptinit as
> being quite bad), and spotted some "%5.2f%%" fields in printf() calls,
> some of which should evidently be "%6.2f%%" as it's possible for some
> of the fields to reach 100.00%, e.g. (apologies for long lines)

Oops, that was a typo.

>
> ...
> 
> I don't know off-hand which fields can reach 100% and which can't;
> could someone more knowledgeable give these a tweak?

I've just changed all of the %5.2f's (theoretically...).

Thanks for spotting it.


Bye
 Sven

Index: Src/Modules/zprof.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/zprof.c,v
retrieving revision 1.1.1.6
diff -u -r1.1.1.6 zprof.c
--- Src/Modules/zprof.c	2000/02/23 15:18:47	1.1.1.6
+++ Src/Modules/zprof.c	2001/03/20 09:32:33
@@ -168,7 +168,7 @@
 
 	printf("num  calls                time                       self            name\n-----------------------------------------------------------------------------------\n");
 	for (fp = fs, i = 1; *fp; fp++, i++) {
-	    printf("%2ld) %4ld       %8.2f %8.2f  %5.2f%%  %8.2f %8.2f  %5.2f%%  %s\n",
+	    printf("%2ld) %4ld       %8.2f %8.2f  %6.2f%%  %8.2f %8.2f  %6.2f%%  %s\n",
 		   ((*fp)->num = i),
 		   (*fp)->calls,
 		   (*fp)->time, (*fp)->time / ((double) (*fp)->calls),
@@ -184,14 +184,14 @@
 	    printf("\n-----------------------------------------------------------------------------------\n\n");
 	    for (ap = as; *ap; ap++)
 		if ((*ap)->to == *fp) {
-		    printf("    %4ld/%-4ld  %8.2f %8.2f  %5.2f%%  %8.2f %8.2f             %s [%ld]\n",
+		    printf("    %4ld/%-4ld  %8.2f %8.2f  %6.2f%%  %8.2f %8.2f             %s [%ld]\n",
 			   (*ap)->calls, (*fp)->calls,
 			   (*ap)->time, (*ap)->time / ((double) (*ap)->calls),
 			   ((*ap)->time / total) * 100.0,
 			   (*ap)->self, (*ap)->self / ((double) (*ap)->calls),
 			   (*ap)->from->name, (*ap)->from->num);
 		}
-	    printf("%2ld) %4ld       %8.2f %8.2f  %5.2f%%  %8.2f %8.2f  %5.2f%%  %s\n",
+	    printf("%2ld) %4ld       %8.2f %8.2f  %6.2f%%  %8.2f %8.2f  %6.2f%%  %s\n",
 		   (*fp)->num, (*fp)->calls,
 		   (*fp)->time, (*fp)->time / ((double) (*fp)->calls),
 		   ((*fp)->time / total) * 100.0,
@@ -200,7 +200,7 @@
 		   (*fp)->name);
 	    for (ap = as + narcs - 1; ap >= as; ap--)
 		if ((*ap)->from == *fp) {
-		    printf("    %4ld/%-4ld  %8.2f %8.2f  %5.2f%%  %8.2f %8.2f             %s [%ld]\n",
+		    printf("    %4ld/%-4ld  %8.2f %8.2f  %6.2f%%  %8.2f %8.2f             %s [%ld]\n",
 			   (*ap)->calls, (*ap)->to->calls,
 			   (*ap)->time, (*ap)->time / ((double) (*ap)->calls),
 			   ((*ap)->time / total) * 100.0,

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


                 reply	other threads:[~2001-03-20  9:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200103200934.KAA07070@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.dk \
    /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.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).