[m-rev.] diff: improve tools/speed_summary

Zoltan Somogyi zs at cs.mu.OZ.AU
Tue Feb 19 19:16:55 AEDT 2002


tools/speed_summary:
	Add a mechanism for reporting times as a percentage of a given base
	time.

Zoltan.

Index: speed_summary
===================================================================
RCS file: /home/mercury1/repository/mercury/tools/speed_summary,v
retrieving revision 1.4
diff -u -b -r1.4 speed_summary
--- speed_summary	2002/01/18 06:56:21	1.4
+++ speed_summary	2002/02/19 08:16:51
@@ -22,6 +22,10 @@
 # The point of discarding the highest and lowest values is to reduce the impact
 # of non-recurring events such as the initial loading of the program into
 # memory.
+#
+# You can ask for the reported times to be also expressed as a percentage of a
+# given base time by setting the variable BASE on the command line (e.g. with
+# a command such as "speed_summary BASE=13.7 batchname").
 
 NF == 8	{
 		variant = $1;
@@ -92,8 +96,14 @@
 					total += times[variant "@" i];
 				}
 
-				printf "%s average of %d with ignore=%d %9.2f\n",
+				printf "%s average of %d with ignore=%d %9.2f",
 					variant, count, ignore, total/num;
+				if (BASE + 0 != 0) {
+					percent = (100 * total/num) / BASE;
+					printf " (%6.3f%%)", percent;
+				}
+
+				printf "\n"
 			}
 		}
 
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list