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

« back to all changes in this revision

Viewing changes to scripts/plot.py

  • Committer: Michael Hope
  • Date: 2011-09-28 01:21:40 UTC
  • Revision ID: michael.hope@linaro.org-20110928012140-fpgu53cfaocqiu6m
Tags: cortex-strings-1.0-2011.09
Make 1.0-2011.09 release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 
9
9
import pylab
10
10
 
11
 
Record = collections.namedtuple('Record', 'variant test size loops alignment rawtime comment time bytes rate')
 
11
Record = collections.namedtuple('Record', 'variant test size loops rawtime comment time bytes rate')
12
12
 
13
13
def unique(rows, name):
14
14
    """Takes a list of values, pulls out the named field, and returns
76
76
            v.sort(key=lambda x: x.size)
77
77
            V = pylab.array([(x.size, getattr(x, field)) for x in v])
78
78
 
79
 
            # Ensure our results appear
80
 
            order = 1 if variant == 'this' else 0
81
 
 
82
79
            try:
83
80
                # A little hack.  We want the 'all' to be obvious on
84
81
                # the graph
86
83
                    pylab.scatter(V[:,0], V[:,1]/scale, label=variant)
87
84
                    pylab.plot(V[:,0], V[:,1]/scale)
88
85
                else:
89
 
                    pylab.plot(V[:,0], V[:,1]/scale, label=variant, zorder=order)
 
86
                    pylab.plot(V[:,0], V[:,1]/scale, label=variant)
90
87
 
91
88
            except Exception, ex:
92
89
                # michaelh1 likes to run this script while the test is
93
90
                # still running which can lead to bad data
94
 
                print ex, 'on %s of %s' % (variant, test)
 
91
                print ex
95
92
 
96
 
        pylab.legend(loc='lower right', ncol=2, prop={'size': 'small'})
 
93
        pylab.legend(loc='lower right')
 
94
        pylab.semilogx()
97
95
        pylab.xlabel('Block size (B)')
98
96
        pylab.ylabel(ylabel)
99
97
        pylab.title('%s %s' % (test, field))
100
98
        pylab.grid()
101
99
 
102
100
        pylab.savefig('%s-%s.png' % (test, field), dpi=100)
103
 
        pylab.semilogx(basex=2)
 
101
        pylab.semilogx()
104
102
        pylab.savefig('%s-%s-semilog.png' % (test, field), dpi=100)
105
103
        pylab.clf()
106
104