* PATCH: Re: misalignment in zprof output
@ 2001-03-20 9:34 Sven Wischnowsky
0 siblings, 0 replies; only message in thread
From: Sven Wischnowsky @ 2001-03-20 9:34 UTC (permalink / raw)
To: zsh-workers
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-03-20 9:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-20 9:34 PATCH: Re: misalignment in zprof output Sven Wischnowsky
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).