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', prefer='this')
15
alignments = libplot.unique(records, 'alignment')
17
X = pylab.arange(len(alignments))
18
width = 1.0/(len(variants)+1)
20
colours = iter('bgrcmyk')
22
pylab.figure(1).set_size_inches((16, 12))
25
for i, variant in enumerate(variants):
28
for alignment in alignments:
29
matches = [x for x in records if x.variant==variant and x.alignment==alignment]
33
heights.append(match.bytes*match.loops/match.elapsed/(1024*1024))
37
pylab.bar(X+i*width, heights, width, color=colours.next(), label=variant)
41
axes.set_xticklabels(alignments)
42
axes.set_xticks(X + 0.5)
44
pylab.title('Performance of different variants of %(function)s for %(bytes)d byte blocks' % locals())
45
pylab.ylabel('Rate (MB/s)')
46
pylab.legend(loc='upper left', ncol=3)
48
pylab.savefig('alignment-%(function)s-%(bytes)d.png' % locals(), dpi=72)
51
records = libplot.parse()
53
for function in libplot.unique(records, 'function'):
54
for bytes in libplot.unique(records, 'bytes'):
55
plot(records, bytes, function)
59
if __name__ == '__main__':