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

« back to all changes in this revision

Viewing changes to scripts/libplot.py

  • Committer: Michael Hope
  • Date: 2011-08-31 04:04:26 UTC
  • Revision ID: michael.hope@linaro.org-20110831040426-fjpxcmw0zmsrh8cp
Added some scripts to run the benchmarks and to plot the results.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import fileinput
 
2
import collections
 
3
 
 
4
Record = collections.namedtuple('Record', 'variant function bytes loops elapsed rest')
 
5
 
 
6
 
 
7
def parse_value(v):
 
8
    try:
 
9
        return float(v)
 
10
    except ValueError:
 
11
        return v
 
12
 
 
13
 
 
14
def unique(records, name):
 
15
    values = set(getattr(x, name) for x in records)
 
16
    return sorted(values)
 
17
 
 
18
 
 
19
def parse():
 
20
    return [Record(*[parse_value(y) for y in x.split(':')]) for x in fileinput.input()]