Initial revision
authorStephen Adams <edu/mit/csail/zurich/adams>
Thu, 14 Sep 1995 13:22:12 +0000 (13:22 +0000)
committerStephen Adams <edu/mit/csail/zurich/adams>
Thu, 14 Sep 1995 13:22:12 +0000 (13:22 +0000)
v8/src/bench/compare-logs [new file with mode: 0755]

diff --git a/v8/src/bench/compare-logs b/v8/src/bench/compare-logs
new file mode 100755 (executable)
index 0000000..9faaa36
--- /dev/null
@@ -0,0 +1,45 @@
+#!/bin/sh
+#
+# e.g:
+#  echo 'Ignore: bogus1 bogus2' | compare-logs - LOG.7.3 LOG.8.0 | neat
+#
+
+awk '
+BEGIN  {}
+/^Ignore:/     { for (i=2; i<=NF; i++) ign[$i]=1 }
+/^Benchmark:/  { name = $2 }
+/^Time:/       { m[name] = m[name] " " $2; name = "<error>" }
+END    {
+       tests = 0
+       for(i=0;i<100;i++) p[i]=1
+       for (b in m)
+         if (ign[b]!=1) {
+               tests++
+               n = split (m[b], t)
+               printf "%s",b
+               for (i=1; i<=n; i++) {
+                       printf "\t%.2f",t[i]
+                       s[i*10]="-"
+                       for (j=1; j<i; j++) {
+                               r = t[i]/(t[j]+1e-10)
+                               printf "\t%.3f",r
+                               s[i*10+j] += r
+                               p[i*10+j] *= r
+                       }
+               }
+               print ""
+       }
+       printf "~a.mean"
+       for (i = 1; i< 100; i++) {
+               if (s[i]=="-")  printf"\t-"
+               else if (s[i]!="")  printf"\t%.3f",s[i]/tests;
+       }
+       print ""
+       printf "~g.mean"
+       for (i = 1; i< 100; i++) {
+               if (s[i]=="-")  printf"\t-"
+               else if (s[i]!="")  printf"\t%.3f",p[i]^(1/tests);
+       }
+       print ""
+}
+' "$@"
\ No newline at end of file