3
"""Plot the performance of different variants of the string routines
12
def plot(records, bytes):
13
records = [x for x in records if x.bytes==bytes]
15
variants = libplot.unique(records, 'variant', prefer='this')
16
functions = libplot.unique(records, 'function')
18
X = pylab.arange(len(functions))
19
width = 1.0/(len(variants)+1)
21
colours = iter('bgrcmyk')
23
pylab.figure(1).set_size_inches((16, 12))
26
for i, variant in enumerate(variants):
29
for function in functions:
30
matches = [x for x in records if x.variant==variant and x.function==function and x.alignment==8]
34
heights.append(match.bytes*match.loops/match.elapsed/(1024*1024))
38
pylab.bar(X+i*width, heights, width, color=colours.next(), label=variant)
41
axes.set_xticklabels(functions)
42
axes.set_xticks(X + 0.5)
44
pylab.title('Performance of different variants for %d byte blocks' % bytes)
45
pylab.ylabel('Rate (MB/s)')
46
pylab.legend(loc='upper left', ncol=3)
48
pylab.savefig('top-%06d.png' % bytes, dpi=72)
51
records = libplot.parse()
53
for bytes in libplot.unique(records, 'bytes'):
58
if __name__ == '__main__':