home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / source / byteunix.lzh / byte.1 / dhry.awk < prev    next >
Text File  |  1990-05-11  |  2KB  |  51 lines

  1. ###############################################################################
  2. #  The BYTE UNIX Benchmarks - Release 2
  3. #          Module: dhry.awk   SID: 2.3 4/17/90 16:45:41
  4. #          
  5. ###############################################################################
  6. # Bug reports, patches, comments, suggestions should be sent to:
  7. #
  8. #    Ben Smith or Rick Grehan at BYTE Magazine
  9. #    ben@bytepb.UUCP    rick_g@bytepb.UUCP
  10. #
  11. ###############################################################################
  12. #  Modification Log:
  13. #        added geometric mean 8/6/89 -ben
  14. #
  15. ###############################################################################
  16. BEGIN { FS=":"; tsum = 0.000; t2sum = 0.000; t_product = 0.0000;
  17.     dsum = 0.000; d2sum = 0.000; d_product = 0.0000;
  18.     iter = 0;
  19.     }
  20. /real/    { next }  # don't use these times
  21. /user/    { next }
  22. /sys/    { next }
  23. /^$/    { next } 
  24. /^Microseconds/ { 
  25.     t=$2; 
  26.     tsum += t;
  27.     t2sum += t*t;
  28.     if (t) { t_product += log(t); }
  29.         }
  30. /^Dhrystones/ { 
  31.     d=$2; 
  32.     dsum += d;
  33.     d2sum += d*d;
  34.     if (t) { d_product += log(d); }
  35.     iter ++;
  36.         }
  37. END {
  38.     if (iter > 0) { 
  39.         printf "                       Arithmetric        Geometric         Variance\n";
  40.         printf "                              Mean             Mean         (%d tests)\n",iter
  41.         printf "Microseconds/loop:       %9.0f        %9.0f         ",tsum/iter,exp(t_product/iter);
  42.         if (iter > 1) printf "%9.2f\n",(t2sum-tsum*tsum/iter)/(iter-1);
  43.         else printf "n/a\n"
  44.         printf "Dhrystones/sec:          %9.0f        %9.0f         ",dsum/iter,exp(d_product/iter);
  45.         if (iter > 1) printf "%9.2f\n",(d2sum-dsum*dsum/iter)/(iter-1);
  46.         }
  47.     else { 
  48.         print " -- no measured results --"; 
  49.         }
  50.     }
  51.