3
"""Plot the performance of different variants of one routine versus alignment.
11
def plot(records, bytes, function):
12
records = [x for x in records if x.bytes==bytes and x.function==function]
14
variants = libplot.unique(records, 'variant')
15
alignments = libplot.unique(records, 'alignment')
17
X = pylab.arange(len(alignments))
18
width = 1.0/(len(X)+1)
20
colours = iter('bgrcmyk')
24
for i, variant in enumerate(variants):
27
for alignment in alignments:
28
matches = [x for x in records if x.variant==variant and x.alignment==alignment]
32
heights.append(match.bytes*match.loops/match.elapsed/(1024*1024))
36
pylab.bar(X+i*width, heights, width, color=colours.next(), label=variant)
39
axes.set_xticklabels(alignments)
40
axes.set_xticks(X + 0.5)
42
pylab.title('Performance of different variants of %(function)s for %(bytes)d byte blocks' % locals())
43
pylab.ylabel('Rate (MB/s)')
44
pylab.legend(loc='upper left', ncol=2)
46
pylab.savefig('alignment-%(function)s-%(bytes)d.png' % locals())
49
records = libplot.parse()
51
for function in libplot.unique(records, 'function'):
52
for bytes in libplot.unique(records, 'bytes'):
53
plot(records, bytes, function)
57
if __name__ == '__main__':