From 24e142bc49ba4fb9f1ca9420cad2bc95ad455cc7 Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Mon, 5 Nov 2007 17:21:53 -0500 Subject: [PATCH] * Added benchmarks/summarize.pl to summarize benchmark results. --- benchmarks/summarize.pl | 45 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 benchmarks/summarize.pl diff --git a/benchmarks/summarize.pl b/benchmarks/summarize.pl new file mode 100755 index 0000000..b32cc01 --- /dev/null +++ b/benchmarks/summarize.pl @@ -0,0 +1,45 @@ +#!/usr/bin/perl -w + +use strict; + +my %times; +my %benchmarks; +my %runtimes; +my %gctimes; + +{ + my $curtime; + my $curbench; + my $counter = 0; + open F, "){ + if (/^NOW: (.*)/){ + $curtime = $1; + $times{$curtime} = ++$counter; + next; + } + if(/^running stats for (.*):$/){ + $curbench = $1; + $benchmarks{$curbench} ||= ++$counter; + next; + } + if(/^ *(\d*) ms elapsed cpu time, including (\d*) ms collecting$/){ + $runtimes{$curbench}{$curtime} = $1; + $gctimes{$curbench}{$curtime} = $2; + next; + } + } + close F; +} + +my @times = sort { $times{$a} <=> $times{$b} } keys %times; +my @benchmarks = sort { $benchmarks{$a} <=> $benchmarks{$b} } keys %benchmarks; + +foreach my $bench (@benchmarks){ + print "benchmark: $bench\n"; + foreach my $time (@times){ + printf " %6s on $time\n", $runtimes{$bench}{$time}; + } +} + +