pull/11367/head
ncteisen 8 years ago
parent bf1ee7b12f
commit 2b96949d3d
  1. 18
      tools/profiling/microbenchmarks/bm_diff/bm_diff.py
  2. 3
      tools/profiling/microbenchmarks/bm_diff/bm_main.py
  3. 2
      tools/profiling/microbenchmarks/bm_diff/bm_run.py

@ -129,6 +129,7 @@ class Benchmark:
def row(self, flds):
return [self.final[f] if f in self.final else '' for f in flds]
def _read_json(filename, badfiles):
stripped = ".".join(filename.split(".")[:-2])
try:
@ -154,13 +155,17 @@ def diff(bms, loops, track, old, new):
stripped_line = line.strip().replace("/", "_").replace(
"<", "_").replace(">", "_").replace(", ", "_")
js_new_ctr = _read_json('%s.%s.counters.%s.%d.json' %
(bm, stripped_line, new, loop), badfiles)
(bm, stripped_line, new, loop),
badfiles)
js_new_opt = _read_json('%s.%s.opt.%s.%d.json' %
(bm, stripped_line, new, loop), badfiles)
(bm, stripped_line, new, loop),
badfiles)
js_old_ctr = _read_json('%s.%s.counters.%s.%d.json' %
(bm, stripped_line, old, loop), badfiles)
(bm, stripped_line, old, loop),
badfiles)
js_old_opt = _read_json('%s.%s.opt.%s.%d.json' %
(bm, stripped_line, old, loop), badfiles)
(bm, stripped_line, old, loop),
badfiles)
if js_new_ctr:
for row in bm_json.expand_json(js_new_ctr, js_new_opt):
@ -186,7 +191,7 @@ def diff(bms, loops, track, old, new):
for name in sorted(benchmarks.keys()):
if benchmarks[name].skip(): continue
rows.append([name] + benchmarks[name].row(fields))
note += 'flakiness data = %s' % str(badfiles)
note = 'flakiness data = %s' % str(badfiles)
if rows:
return tabulate.tabulate(rows, headers=headers, floatfmt='+.2f'), note
else:
@ -195,7 +200,8 @@ def diff(bms, loops, track, old, new):
if __name__ == '__main__':
args = _args()
diff, note = diff(args.benchmarks, args.loops, args.track, args.old, args.new)
diff, note = diff(args.benchmarks, args.loops, args.track, args.old,
args.new)
print note
print ""
print diff

@ -133,7 +133,8 @@ def main(args):
bm_run.run('new', args.benchmarks, args.jobs, args.loops, args.repetitions)
bm_run.run(old, args.benchmarks, args.jobs, args.loops, args.repetitions)
diff, note = bm_diff.diff(args.benchmarks, args.loops, args.track, old, 'new')
diff, note = bm_diff.diff(args.benchmarks, args.loops, args.track, old,
'new')
if diff:
text = 'Performance differences noted:\n' + diff
else:

@ -107,7 +107,7 @@ def _collect_bm_data(bm, cfg, name, reps, idx, loops):
shortname='%s %s %s %s %d/%d' % (bm, line, cfg, name, idx + 1,
loops),
verbose_success=True,
timeout_seconds=60*10,
timeout_seconds=60 * 10,
timeout_retries=3))
return jobs_list

Loading…
Cancel
Save