diff options
author | Craig Tiller <ctiller@google.com> | 2017-03-08 13:08:40 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-03-08 13:08:40 -0800 |
commit | b432885a565cac6cd9510c8ff05ed9eb2cc0458e (patch) | |
tree | 9d208c55cdabcbcab1f6aee9f7686e607b69a2b7 /tools | |
parent | f5362b1addd4548889ff4ba43d0c66bc04c47fe2 (diff) |
Always write index.html
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/run_tests/run_microbenchmark.py | 71 |
1 files changed, 36 insertions, 35 deletions
diff --git a/tools/run_tests/run_microbenchmark.py b/tools/run_tests/run_microbenchmark.py index e735ff8bf9..09f2eb180e 100755 --- a/tools/run_tests/run_microbenchmark.py +++ b/tools/run_tests/run_microbenchmark.py @@ -228,38 +228,39 @@ argp.add_argument('--summary_time', help='Minimum time to run benchmarks for the summary collection') args = argp.parse_args() -for bm_name in args.benchmarks: - for collect in args.collect: - collectors[collect](bm_name, args) -if args.diff_perf: - if 'summary' not in args.collect: - for bm_name in args.benchmarks: - run_summary(bm_name, 'opt', bm_name) - run_summary(bm_name, 'counters', bm_name) - where_am_i = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']).strip() - subprocess.check_call(['git', 'checkout', args.diff_perf]) - comparables = [] - subprocess.check_call(['make', 'clean']) - try: - for bm_name in args.benchmarks: - try: - run_summary(bm_name, 'opt', '%s.old' % bm_name) - run_summary(bm_name, 'counters', '%s.old' % bm_name) - comparables.append(bm_name) - except subprocess.CalledProcessError, e: - pass - finally: - subprocess.check_call(['git', 'checkout', where_am_i]) - for bm_name in comparables: - diff = subprocess.check_output(['tools/profiling/microbenchmarks/bm_diff.py', - '%s.opt.json' % bm_name, - '%s.counters.json' % bm_name, - '%s.old.opt.json' % bm_name, - '%s.old.counters.json' % bm_name]).strip() - if diff: - heading('Performance diff: %s' % bm_name) - text(diff) - -index_html += "</body>\n</html>\n" -with open('reports/index.html', 'w') as f: - f.write(index_html) +try: + for bm_name in args.benchmarks: + for collect in args.collect: + collectors[collect](bm_name, args) + if args.diff_perf: + if 'summary' not in args.collect: + for bm_name in args.benchmarks: + run_summary(bm_name, 'opt', bm_name) + run_summary(bm_name, 'counters', bm_name) + where_am_i = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']).strip() + subprocess.check_call(['git', 'checkout', args.diff_perf]) + comparables = [] + subprocess.check_call(['make', 'clean']) + try: + for bm_name in args.benchmarks: + try: + run_summary(bm_name, 'opt', '%s.old' % bm_name) + run_summary(bm_name, 'counters', '%s.old' % bm_name) + comparables.append(bm_name) + except subprocess.CalledProcessError, e: + pass + finally: + subprocess.check_call(['git', 'checkout', where_am_i]) + for bm_name in comparables: + diff = subprocess.check_output(['tools/profiling/microbenchmarks/bm_diff.py', + '%s.opt.json' % bm_name, + '%s.counters.json' % bm_name, + '%s.old.opt.json' % bm_name, + '%s.old.counters.json' % bm_name]).strip() + if diff: + heading('Performance diff: %s' % bm_name) + text(diff) +finally: + index_html += "</body>\n</html>\n" + with open('reports/index.html', 'w') as f: + f.write(index_html) |