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

« back to all changes in this revision

Viewing changes to scripts/plot-sizes.py

  • Committer: Will Newton
  • Date: 2013-06-25 14:07:04 UTC
  • Revision ID: will.newton@linaro.org-20130625140704-jp1ad8y2p8d416qk
Support multiple runs of each benchmark.

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
        matches = [x for x in records if x.variant==variant and x.bytes <= top]
55
55
        matches.sort(key=lambda x: x.bytes)
56
56
 
57
 
        X = [x.bytes for x in matches]
58
 
        Y = [x.bytes*x.loops/x.elapsed/(1024*1024) for x in matches]
 
57
        X = sorted(list(set([x.bytes for x in matches])))
 
58
        Y = []
 
59
        Yerr = []
 
60
        for xbytes in X:
 
61
            vals = [x.bytes*x.loops/x.elapsed/(1024*1024) for x in matches if x.bytes == xbytes]
 
62
            if len(vals) > 1:
 
63
                mean = sum(vals)/len(vals)
 
64
                Y.append(mean)
 
65
                if len(Yerr) == 0:
 
66
                    Yerr = [[], []]
 
67
                err1 = max(vals) - mean
 
68
                assert err1 >= 0
 
69
                err2 = min(vals) - mean
 
70
                assert err2 <= 0
 
71
                Yerr[0].append(abs(err2))
 
72
                Yerr[1].append(err1)
 
73
            else:
 
74
                Y.append(vals[0])
59
75
 
60
76
        all_x.extend(X)
61
77
        colour = colours.next()
62
78
 
63
79
        if X:
64
80
            pylab.plot(X, Y, c=colour)
65
 
            pylab.scatter(X, Y, c=colour, label=variant, edgecolors='none')
 
81
            if len(Yerr) > 0:
 
82
                pylab.errorbar(X, Y, yerr=Yerr, c=colour, label=variant, fmt='o')
 
83
            else:
 
84
                pylab.scatter(X, Y, c=colour, label=variant, edgecolors='none')
66
85
 
67
86
    pylab.legend(loc='upper left', ncol=3, prop={'size': 'small'})
68
87
    pylab.grid()