# /u/sy/beebe/src/x11perf/two-tests.awk, Sat Jul 3 08:20:13 1993 # Edit by Nelson H. F. Beebe # ======================================================================== # Extract x11perf timing results from the output of two runs of # hpux.sh (or sgi.sh, or solaris.sh, ...) and print a table of # relative performance. The argument order should be SLOWER FASTER! # # Usage: # nawk -f two-test.awk typescript.1 typescript.2 >outfile # # [02-Apr-1994] # ======================================================================== /^Test: / { name = $2 } $2 ~ /trep/ { gsub(/[()]/,"",$0) ops = $6 gsub(/\/sec:/,"",ops) test = ($NF == "kids") ? name "-" $(NF-1) "-kids" : name if (FILENAME == ARGV[1]) rate1[test] = ops else if (FILENAME == ARGV[2]) rate2[test] = ops } END { nr = 0 maxratio = -(2^30 + (2^30 - 1)) minratio = 2^30 + (2^30 - 1) sum = 0 sumsq = 0 rsum = 0 prod = 1 for (test in rate1) { ratio = rate2[test]/rate1[test] if (ratio > 0) { nr++ sum += ratio sumsq += ratio * ratio rsum += 1.0/ratio prod *= ratio if (ratio > maxratio) maxratio = ratio if (ratio < minratio) minratio = ratio } } print "=========================================================================" print " Comparison of x11perf benchmark results for two machines." print "" print "Columns 1 and 2 are measured in operations/second and cannot be compared" print "between benchmarks. The ratios in column 3 show how much faster machine" print "2 is than machine 1. For a single number representative of the average" print "speedup, use the harmonic mean, PROVIDED that machine 2 is the faster." print "" print "Machine 1 = " ARGV[1] print "Machine 2 = " ARGV[2] print "" print "Benchmark count = ", nr print "Sum = ", sum print "Max = ", maxratio print "Min = ", minratio print "Arithmetic mean = ", sum/nr print "Harmonic mean = ", nr/rsum print "Geometric mean = ", prod^(1.0/nr) if (nr > 1) variance = (nr*sumsq - sum*sum)/(nr*(nr-1)) else variance = 0 stddev = sqrt(variance) print "Standard deviation = ", stddev print "Variance = ", variance print "Root-mean-square = ", sqrt(sumsq/nr) print "" print "=========================================================================" printf("%-25s\t%10s\t%10s\t%s\n","x11perf benchmark","Machine 1",\ "Machine 2","Ratio 2:1") print "" for (test in rate1) printf("%-25s\t%10s\t%10s\t%s\n", test, rate1[test], rate2[test], (rate1[test] == 0) ? " -n/a- " : \ sprintf("%8.3f",rate2[test]/rate1[test])) | \ "sort +3nr -4" print "=========================================================================" }