[m-dev.] diff: speed_summary

Zoltan Somogyi zs at cs.mu.OZ.AU
Wed Aug 9 14:22:31 AEST 2000


tools/speed_summary:
	An awk script to summarize the files generates by speedtest,
	by averaging the user-mode times automatically.

Zoltan.

#!/usr/bin/awk -f
/^mercury_compile/	{
				if ($1 != cur_version && cur_version != "")
				{
					printf "%s %9.2f\n",
						cur_version,
						cur_total / cur_counter;
					cur_version = "";
					cur_counter = 0.0;
					cur_total = 0.0;
				}

				time = substr($2, 1, length($2) - 1);
				# printf "%9.2f\n", time;

				cur_version = $1;
				cur_counter++;
				cur_total += time;

				next;
			}
			{
				if ($1 != cur_version && cur_version != "")
				{
					printf "%s %9.2f\n",
						cur_version,
						cur_total / cur_counter;
					cur_version = "";
					cur_counter = 0.0;
					cur_total = 0.0;
				}

				print;
			}
END			{
				if (cur_version != "")
				{
					printf "%s %9.2f\n",
						cur_version,
						cur_total / cur_counter;
				}
			}
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list