aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-09-18 13:20:06 +0000
committerlloyd <[email protected]>2008-09-18 13:20:06 +0000
commitdcdd66046cb703b087b273f9a12e9eb8f3e80bd7 (patch)
tree4684d0ae3802c8503e706261d4c56787cfc52ff3
parent9b533f724d6bc0310bc1b7944c9fa66a2ad202bb (diff)
Perl script that combines multiple benchmark outputs into a single HTML file
-rwxr-xr-xmisc/scripts/combine_bmarks.pl120
1 files changed, 120 insertions, 0 deletions
diff --git a/misc/scripts/combine_bmarks.pl b/misc/scripts/combine_bmarks.pl
new file mode 100755
index 000000000..b6436496e
--- /dev/null
+++ b/misc/scripts/combine_bmarks.pl
@@ -0,0 +1,120 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+my %results;
+my %pk;
+
+my %pk_algos;
+my %algos;
+
+my %filename_to_desc;
+
+for my $filename (@ARGV) {
+
+ open IN, "<$filename" or die "Couldn't read $filename ($!)\n";
+
+ my $desc = <IN>;
+ chomp $desc;
+
+ $results{$desc} = {};
+
+ while(<IN>) {
+ if(/(.*): +(.*) Mbytes\/sec/) {
+ $results{$desc}{$1} = $2;
+ $algos{$1} = undef;
+ }
+ if(/(.*): (.*) ops \/ second \((.*)\)/) {
+ my $alg = "$1";
+ $alg = "$alg $3" if defined($3);
+ $pk{$desc}{$alg} = $2;
+ $pk_algos{$alg} = undef;
+ }
+ }
+}
+
+
+sub print_table {
+ my @columns = sort keys %results;
+
+ print "\n<P>All results are in MiB / second:\n";
+ print "<TABLE BORDER CELLSPACING=1>\n<THEAD>\n";
+
+ my %col_index = ();
+
+ my $line = "<TR><TH>Algorithm ";
+
+ foreach my $col (@columns) {
+ $col_index{$col} = length($line);
+ $line .= "<TH>" . $col . " ";
+ }
+
+ $line .= "\n<TBODY>\n";
+
+ print $line;
+
+ $line = '';
+
+ foreach my $algo (sort keys %algos) {
+ $line = " <TR><TH>$algo ";
+
+ for my $col (@columns) {
+ my $result = $results{$col}{$algo};
+ $result = "-" if not defined($result);
+
+ $result = "<TH>$result";
+
+ $line .= ' ' while(length($line) < ($col_index{$col}));
+ $line .= $result;
+
+ }
+
+ print $line, "\n";
+ $line = '';
+ }
+
+ print "</TABLE>\n";
+}
+
+
+sub print_pk_table {
+ my @columns = sort keys %pk;
+
+ print "\n<P>All results are in operations per second:\n";
+ print "<TABLE BORDER CELLSPACING=1>\n<THEAD>\n";
+
+ my %col_index = ();
+
+ my $line = "<TR><TH>Algorithm ";
+
+ foreach my $col (@columns) {
+ $col_index{$col} = length($line);
+ $line .= "<TH>" . $col . " ";
+ }
+
+ $line .= "\n<TBODY>\n";
+
+ print $line;
+
+ foreach my $algo (sort keys %pk_algos) {
+ my $line = " <TR><TH>$algo ";
+
+ for my $col (@columns) {
+ my $result = $pk{$col}{$algo};
+ $result = '-' if not defined($result);
+
+ $result = "<TH>$result";
+
+ $line .= ' ' while(length($line) < ($col_index{$col}));
+ $line .= $result;
+
+ }
+
+ print $line, "\n";
+ }
+
+ print "</TABLE>\n";
+}
+
+print_table();
+print_pk_table();