Commit 37d24e29 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 5e042262
...@@ -31,6 +31,8 @@ from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes, mark_inset, ...@@ -31,6 +31,8 @@ from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes, mark_inset,
from scipy.stats import ttest_ind_from_stats from scipy.stats import ttest_ind_from_stats
usop = Unit(u'µs/op')
# BenchSeries represents several runs of a benchmark with different "·<n>". # BenchSeries represents several runs of a benchmark with different "·<n>".
# #
...@@ -191,7 +193,6 @@ class merger: ...@@ -191,7 +193,6 @@ class merger:
def Bmerge(B, merger): def Bmerge(B, merger):
Bmerge = Benchmark() Bmerge = Benchmark()
Bname = B.byname() Bname = B.byname()
usop = Unit(u'µs/op')
for name in Bname.keys(): for name in Bname.keys():
bv = Bname.get(name) bv = Bname.get(name)
if bv is None: if bv is None:
...@@ -385,59 +386,41 @@ def plotlat1(ax, S, Bnode): ...@@ -385,59 +386,41 @@ def plotlat1(ax, S, Bnode):
# mark first values with dedicated y ticks # mark first values with dedicated y ticks
add_yvalueticks(ax, yticks0) add_yvalueticks(ax, yticks0)
# --- node-local basic operations --- # --- node-local basic operations ---
_plotnode1(ax, Bnode)
def _plotnode1(ax, Bnode):
B = mergebynode(Bnode) B = mergebynode(Bnode)
B = mergepygo(B) B = mergepygo(B)
Bu = B.byunit()
""" Bn = Bu[usop].byname() # XXX µs/op hardcoded. FIXME disk/*
# {} node {} name -> Stats print
Bnodename = OrderedDict() yticks = set()
for node in Bnode: for name in Bn:
Sname = OrderedDict() # {} name -> Stats
Bname = Bnode[node].byname()
for name in Bname:
if _lat1_skipname(name): if _lat1_skipname(name):
continue continue
Sname[name] = Bname[name].stats() print name
b = Bn[name]
# try merge <bench>/py with <bench>/go s = b.stats()
Smerge = OrderedDict() # {} name -> Stats yticks.add(s.avg)
for name in Sname.keys(): c, w = 1.1, 0.05
s = Sname.get(name) lw = 0.5
if s is None: ax.plot([c-w, c+w], [s.min]*2, lw=lw) # XXX **stylefor[name]
continue # was merged/deleted ax.plot([c-w, c+w], [s.max]*2, lw=lw) # XXX **stylefor[name]
ax.plot([c]*2, [s.min, s.max], lw=lw) # XXX **stylefor[name]
# ex: unzlib/py/null-1K
# ex: disk/randread/direct/4K-avg # mark node-local values with ticks at right
namev = name.split('/') ax2 = ax.twinx()
if len(namev) >= 2 and namev[1] in ('py', 'go'): ax2.set_ylim(ax.get_ylim())
namev_ = namev[:] # copy ax2.set_yticks([])
namev_[1] = pygoswap[namev_[1]] add_yvalueticks(ax2, yticks)
name_ = '/'.join(namev_)
s_ = Sname[name_]
# ok to merge if either probably same or the difference is < 1µs
_ = ttest_ind_from_stats(s.avg, s.std, s.ninliers, s_.avg, s_.std, s_.ninliers)
if _.pvalue >= 0.3 or abs(s.avg - s_.avg) < 1.0:
print 'merging %s (%s)\t+ %s (%s) (%s)' % (name, s, name_, s_, _)
del Sname[name]
del Sname[name_]
bmerge = Benchmark(Bname[name] + Bname[name_])
s = bmerge.stats()
namev[1] = '*'
name = '/'.join(namev)
Smerge[name] = s
"""
# benchmarks not to show # benchmarks not to show
_lat1_skipre_v = [re.compile(_) for _ in [ _lat1_skipre_v = [re.compile(_) for _ in [
'adler32/.*', '.*adler32/.*',
'.*2M', '.*2M',
'.*/prod1-max', '.*/prod1-max',
'.*-min', '.*-min',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment