aboutsummaryrefslogtreecommitdiffstats
path: root/doc/scripts/combine_bmarks.pl
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-09-29 20:17:08 +0000
committerlloyd <[email protected]>2008-09-29 20:17:08 +0000
commit7c0319368d1948d54db514e5f72c589a397e2909 (patch)
tree2d52b6dd8715a6ea0fc21b3a66673fb38a8d4ebb /doc/scripts/combine_bmarks.pl
parent0f2dfff90fe3882a85308d66a05803178a452023 (diff)
Remove the misc dir:
Moved XS, Boost Python, and SWIG wrappers to new toplevel directory 'wrappers' Moved NIST X.509 test suite into checks directory Move the build information used by configure.pl to src/build-data Move scripts directory to doc (for lack of a better spot)
Diffstat (limited to 'doc/scripts/combine_bmarks.pl')
-rwxr-xr-xdoc/scripts/combine_bmarks.pl120
1 files changed, 120 insertions, 0 deletions
diff --git a/doc/scripts/combine_bmarks.pl b/doc/scripts/combine_bmarks.pl
new file mode 100755
index 000000000..b6436496e
--- /dev/null
+++ b/doc/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();