3
"""Plot the results of benchmarking different variants of the string
15
records = libplot.parse()
16
records = [x for x in records if x.bytes==bytes]
18
variants = libplot.unique(records, 'variant')
19
functions = libplot.unique(records, 'function')
21
X = pylab.arange(len(functions))
22
width = 1.0/(len(X)+1)
24
colours = iter('bgrcmyk')
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]
34
heights.append(match.bytes*match.loops/match.elapsed)
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)
48
if __name__ == '__main__':