~linaro-toolchain-dev/cortex-strings/trunk

« back to all changes in this revision

Viewing changes to scripts/plot-align.py

  • Committer: Michael Hope
  • Date: 2011-09-08 03:27:40 UTC
  • Revision ID: michael.hope@linaro.org-20110908032740-l0rx3olleapcwk6f
Benchmark more sizes and alignments.  Make the figures bigger to make the text smaller.  Put the 'this' results first.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
def plot(records, bytes, function):
12
12
    records = [x for x in records if x.bytes==bytes and x.function==function]
13
13
 
14
 
    variants = libplot.unique(records, 'variant')
 
14
    variants = libplot.unique(records, 'variant', prefer='this')
15
15
    alignments = libplot.unique(records, 'alignment')
16
16
 
17
17
    X = pylab.arange(len(alignments))
18
 
    width = 1.0/(len(X)+1)
 
18
    width = 1.0/(len(variants)+1)
19
19
 
20
20
    colours = iter('bgrcmyk')
21
21
 
 
22
    pylab.figure(1).set_size_inches((16, 12))
22
23
    pylab.clf()
23
24
 
24
25
    for i, variant in enumerate(variants):
35
36
 
36
37
        pylab.bar(X+i*width, heights, width, color=colours.next(), label=variant)
37
38
 
 
39
 
38
40
    axes = pylab.axes()
39
41
    axes.set_xticklabels(alignments)
40
42
    axes.set_xticks(X + 0.5)
41
43
 
42
44
    pylab.title('Performance of different variants of %(function)s for %(bytes)d byte blocks' % locals())
43
45
    pylab.ylabel('Rate (MB/s)')
44
 
    pylab.legend(loc='upper left', ncol=2)
 
46
    pylab.legend(loc='upper left', ncol=3)
45
47
    pylab.grid()
46
 
    pylab.savefig('alignment-%(function)s-%(bytes)d.png' % locals())
 
48
    pylab.savefig('alignment-%(function)s-%(bytes)d.png' % locals(), dpi=72)
47
49
 
48
50
def main():
49
51
    records = libplot.parse()