summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2011-09-06 14:51:08 -0700
committerEric Anholt <eric@anholt.net>2011-09-08 23:03:26 -0700
commit701c7392029e2364d3de14d31f22e99ae421e389 (patch)
tree117688448f6e0879b899a57ff4d311d3801ebe4c
parent219e8bbd764ff8366ad796a34375eb735eb1e79c (diff)
report: Sort the harmed programs by relative size change.
-rwxr-xr-xreport.pl10
1 files changed, 7 insertions, 3 deletions
diff --git a/report.pl b/report.pl
index 35af948..d1ecf87 100755
--- a/report.pl
+++ b/report.pl
@@ -57,7 +57,7 @@ while (my ($prog, $before_count) = each(%before)) {
}
if ($after_count > $before_count) {
- $hurt_programs{$prog} = 1;
+ $hurt_programs{$prog} = $after_count / $before_count;
}
printf("%s: %4d -> %4d\n",
@@ -98,8 +98,12 @@ my $header = 0;
if (keys(%hurt_programs) != 0) {
printf("hurt programs:\n");
+ my @names = keys %hurt_programs;
+ my @sorted = sort {
+ $hurt_programs{$a} <=> $hurt_programs{$b}
+ } @names;
- while (my ($prog, $junk) = each(%hurt_programs)) {
- printf("%s\n", $prog);
+ foreach (@sorted) {
+ printf("%s: %.02f%%\n", $_, $hurt_programs{$_} * 100 - 100);
}
}