aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/bench_compare.py
diff options
context:
space:
mode:
authorGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-21 19:10:05 +0000
committerGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-21 19:10:05 +0000
commitf3d3d968c87f5e16d05612008b613211ad937d16 (patch)
tree943b699eb8b2bb8523bb49c50ab9b889d0810801 /bench/bench_compare.py
parent9299eded3838a7997235ff033aa3b9a8d4c6d4d4 (diff)
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
Diffstat (limited to 'bench/bench_compare.py')
-rw-r--r--bench/bench_compare.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/bench/bench_compare.py b/bench/bench_compare.py
index c1a1ff9c20..d853358d2c 100644
--- a/bench/bench_compare.py
+++ b/bench/bench_compare.py
@@ -13,6 +13,12 @@ def usage():
print '-o <file> the old bench output file.'
print '-n <file> the new bench output file.'
print '-h causes headers to be output.'
+ print '-s <stat> 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 <fieldSpec> 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: