3
"""Plot the performance for different block sizes of one function across
12
def plot(records, function):
13
variants = libplot.unique(records, 'variant')
14
records = [x for x in records if x.function==function]
16
bytes = libplot.unique(records, 'bytes')
18
colours = iter('bgrcmyk')
22
for variant in variants:
23
matches = [x for x in records if x.variant==variant]
24
matches.sort(key=lambda x: x.bytes)
26
X = [x.bytes for x in matches]
27
Y = [x.bytes*x.loops/x.elapsed/(1024*1024) for x in matches]
29
colour = colours.next()
32
pylab.plot(X, Y, c=colour)
33
pylab.scatter(X, Y, c=colour, label=variant)
35
pylab.legend(loc='upper left')
37
pylab.title('%s in MB/s' % function)
38
pylab.xlabel('Size (B)')
39
pylab.ylabel('Rate (MB/s)')
42
pylab.ylim(0, pylab.ylim()[1])
45
records = libplot.parse()
47
functions = libplot.unique(records, 'function')
49
for function in functions:
50
plot(records, function)
51
pylab.savefig('sizes-%s.png' % function)
53
if __name__ == '__main__':