From f3d3d968c87f5e16d05612008b613211ad937d16 Mon Sep 17 00:00:00 2001 From: "djsollen@google.com" Date: Tue, 21 Aug 2012 19:10:05 +0000 Subject: [PATCH] Update bench_compare to do the comparison using different statistical methods Review URL: https://codereview.appspot.com/6461110 git-svn-id: http://skia.googlecode.com/svn/trunk@5217 2bbb7eff-a529-9590-31e7-b0007b416f81 --- bench/bench_compare.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/bench/bench_compare.py b/bench/bench_compare.py index c1a1ff9c2..d853358d2 100644 --- a/bench/bench_compare.py +++ b/bench/bench_compare.py @@ -13,6 +13,12 @@ def usage(): print '-o the old bench output file.' print '-n the new bench output file.' print '-h causes headers to be output.' + print '-s the type of statistical analysis used' + print ' Not specifying is the same as -s "avg".' + print ' avg: average of all data points' + print ' min: minimum of all data points' + print ' med: median of all data points' + print ' 25th: twenty-fifth percentile for all data points' print '-f which fields to output and in what order.' print ' Not specifying is the same as -f "bctondp".' print ' b: bench' @@ -46,7 +52,7 @@ def main(): """Parses command line and writes output.""" try: - opts, _ = getopt.getopt(sys.argv[1:], "f:o:n:h") + opts, _ = getopt.getopt(sys.argv[1:], "f:o:n:s:h") except getopt.GetoptError, err: print str(err) usage() @@ -77,6 +83,7 @@ def main(): header_format = "" columns = 'bctondp' header = False + stat_type = "avg" for option, value in opts: if option == "-o": @@ -87,6 +94,8 @@ def main(): header = True elif option == "-f": columns = value + elif option == "-s": + stat_type = value else: usage() assert False, "unhandled option" @@ -114,8 +123,8 @@ def main(): , diffp='diffP' ) - old_benches = bench_util.parse({}, open(old, 'r')) - new_benches = bench_util.parse({}, open(new, 'r')) + old_benches = bench_util.parse({}, open(old, 'r'), stat_type) + new_benches = bench_util.parse({}, open(new, 'r'), stat_type) bench_diffs = [] for old_bench in old_benches: