pull/10336/head
Craig Tiller 8 years ago
parent 4efb5e16dc
commit a87b138187
  1. 7
      tools/profiling/microbenchmarks/bm_diff.py

@ -137,12 +137,14 @@ class Benchmark:
new = self.samples[True][f] new = self.samples[True][f]
old = self.samples[False][f] old = self.samples[False][f]
if not new or not old: continue if not new or not old: continue
print f, new, old p = stats.ttest_ind(new, old)[1]
p = stats.ttest_ind(new, old)
if p < args.p_threshold: if p < args.p_threshold:
self.final[f] = avg(new) - avg(old) self.final[f] = avg(new) - avg(old)
return self.final.keys() return self.final.keys()
def skip(self):
return not self.final
def row(self, flds): def row(self, flds):
return [self.final[f] if f in self.final else '' for f in flds] return [self.final[f] if f in self.final else '' for f in flds]
@ -176,5 +178,6 @@ fields = [f for f in _INTERESTING if f in really_interesting]
headers = ['Benchmark'] + fields headers = ['Benchmark'] + fields
rows = [] rows = []
for name in sorted(benchmarks.keys()): for name in sorted(benchmarks.keys()):
if benchmarks[name].skip(): continue
rows.append([name] + benchmarks[name].row(fields)) rows.append([name] + benchmarks[name].row(fields))
print tabulate.tabulate(rows, headers=headers, floatfmt='+.2f') print tabulate.tabulate(rows, headers=headers, floatfmt='+.2f')

Loading…
Cancel
Save