3 compare_bench.py - Compare two benchmarks or their results and report the
8 from gbench import util, report
11 # Parse the command line flags
13 print('compare_bench.py <test1> <test2> [benchmark options]...')
15 if '--help' in sys.argv or len(sys.argv) < 3:
18 bench_opts = sys.argv[3:]
19 bench_opts = list(bench_opts)
20 # Run the benchmarks and report the results
21 json1 = gbench.util.run_or_load_benchmark(tests[0], bench_opts)
22 json2 = gbench.util.run_or_load_benchmark(tests[1], bench_opts)
23 output_lines = gbench.report.generate_difference_report(json1, json2)
24 print 'Comparing %s to %s' % (tests[0], tests[1])
25 for ln in output_lines:
29 if __name__ == '__main__':