Commit 5369d45c authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 12722462
......@@ -132,8 +132,8 @@ class _pygomerger:
m = _bench_py_re.match(name)
assert m is not None
# XXX should be actually checking namev
# XXX 'py,go' -> '*' ?
return name[:m.start(1)] + 'py,go' + name[m.end(1):]
# XXX 'py,go' <-> '*' ?
return name[:m.start(1)] + '*' + name[m.end(1):]
def mergepygo(B):
return Bmerge(B, _pygomerger())
......@@ -169,8 +169,10 @@ class _prefixmerger:
assert tail == _tail, (tail, _tail)
prefixv.append(_prefix)
# XXX if set(prefixv) == set(self.prefixv) -> '*'
prefix = ','.join(prefixv)
if set(prefixv) == set(self.prefixv):
prefix = '*'
else:
prefix = ','.join(prefixv)
return '%s/%s' % (prefix, tail)
......@@ -268,7 +270,12 @@ def add_yvalueticks(ax, yv, fmt='%d'):
d = '^' # shift a bit up
#d = '^_' # shift a bit up
l = (r'${}%%s{%s}$' % fmt) % (d, y)
if isinstance(fmt, (str, unicode)):
ytext = fmt % y
else:
ytext = fmt(y)
l = r'${}%s{%s}$' % (d, ytext)
#l = r'${}%s{{}%s{%d}}$' % (d[0], d[1], y)
ylabv.append(l)
......@@ -291,14 +298,14 @@ _stylefor = {
}
_stylefor_re = [(re.compile(_), sty) for _,sty in [
('crc32/.*/1K', _(color='C5')),
('crc32/.*/4K', _(color='C5')), # XXX distinguish
('sha1/.*/1K', _(color='C6')),
('sha1/.*/4K', _(color='C6')), # XXX
('unzlib/.*/null-1K', _(color='C7')),
('unzlib/.*/null-4K', _(color='C7')), # XXX
('unzlib/.*/wczdata', _(color='C7')), # XXX
('unzlib/.*/prod1-avg', _(color='C7')), # XXX
(r'crc32/(py|\*)/4K', _(color='C5')),
(r'crc32/go/4K', _(color='C5', ls='dashed')),
(r'sha1/(py\|*)/4K', _(color='C6')),
(r'sha1/go/4K', _(color='C6', ls='dashed')),
(r'unzlib/(py|\*)/wczdata', _(color='C7')),
(r'unzlib/go/wczdata', _(color='C7', ls='dashed')),
(r'unzlib/(py|\*)/prod1-avg', _(color='C8')),
(r'unzlib/go/prod1-avg', _(color='C8', ls='dashed')),
]]
del _
......@@ -415,22 +422,32 @@ def plotlat1(ax, S):
# plotnode1 plots latencies of base CPU/disk operations on the nodes.
def plotnode1(ax, B, w=0.05):
def plotnode1(ax, B, w=0.05, details=False):
Bu = B.byunit()
Bn = Bu[usop].byname() # XXX µs/op hardcoded. FIXME disk/*
S = dict((_, Bn[_].stats()) for _ in Bn) # {} name -> stats
print
yticks = set()
for name in Bn:
yticknames = {} # ytick -> []name
# order plots (and thus their order in legend) by value
namev = S.keys()
namev.sort(key = lambda _: S[_].avg, reverse=True)
for name in namev:
if _lat1_skipname(name):
continue
print name
b = Bn[name]
s = b.stats()
node, xname = name.split('/', 1)
yticks.add(s.avg)
yticknames.setdefault(s.avg, []).append(node) # XXX name
c = 1.1
lw = 0.5
ax.plot([c-w, c+w], [s.min]*2, lw=lw, **stylefor(name))
if details:
lw = 1.5
ax.plot([c-w, c+w], [s.min]*2, lw=lw, label=xname, **stylefor(name))
ax.plot([c-w, c+w], [s.max]*2, lw=lw, **stylefor(name))
ax.plot([c]*2, [s.min, s.max], lw=lw, **stylefor(name))
......@@ -438,14 +455,25 @@ def plotnode1(ax, B, w=0.05):
ax2 = ax.twinx()
ax2.set_ylim(ax.get_ylim())
ax2.set_yticks([])
add_yvalueticks(ax2, yticks, fmt='%.1f')
fmt='%d'
if details:
def fmt(y):
namev = yticknames[y]
return r'%.1f\ %s' % (y, ', '.join(namev))
add_yvalueticks(ax2, yticks, fmt=fmt)
if details:
ax.legend(loc='upper left', fontsize='x-small', #markerfirst=False,
bbox_transform=ax.transAxes, bbox_to_anchor=(1.3, 1), borderaxespad=0) # XXX hack to shift right
# benchmarks not to show
_lat1_skipre_v = [re.compile(_) for _ in [
'.*adler32/.*',
'.*1K',
'.*2M',
'.*/unzlib/.*null',
'.*/prod1-max',
'.*-min',
]]
......@@ -608,7 +636,7 @@ def main():
ax211.set_xlim(zxmin, zxmax)
ax211.set_xticks([])
ax211.set_xticklabels([])
plotnode1(ax211, B, w=0.007)
plotnode1(ax211, B, w=0.007, details=True)
......
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