1 | # Read thesis-append-pbv.csv
|
---|
2 | # Output for string-graph-pta-sharing.dat
|
---|
3 |
|
---|
4 | # Project details
|
---|
5 | # Filter operation=peq
|
---|
6 | # Split "series" goups of sut; only those in the "pretty" list
|
---|
7 | # Assert one row per string-length
|
---|
8 | # output:
|
---|
9 | # string-len op-duration
|
---|
10 | # in chunks, each headed by pertty(sut)
|
---|
11 |
|
---|
12 | import pandas as pd
|
---|
13 | import numpy as np
|
---|
14 | import os
|
---|
15 | import sys
|
---|
16 |
|
---|
17 | sys.path.insert(0, os.path.dirname(__file__))
|
---|
18 | from common import *
|
---|
19 |
|
---|
20 | prettyFieldNames = {
|
---|
21 | "peq": {
|
---|
22 | "cfa-ll-share-fresh": "{/Helvetica=15 C{/Symbol \\42} x += y} share fresh",
|
---|
23 | "stl-na-na-fresh": "STL {/Helvetica=15 x += y} fresh",
|
---|
24 | },
|
---|
25 | "pta": {
|
---|
26 | "cfa-ll-share-fresh": "{/Helvetica=15 C{/Symbol \\42} x = x + y} share fresh",
|
---|
27 | "stl-na-na-fresh": "STL {/Helvetica=15 x = x + y} fresh",
|
---|
28 | }
|
---|
29 | }
|
---|
30 |
|
---|
31 | timings = loadParseTimingData('result-append-pbv.csv')
|
---|
32 |
|
---|
33 |
|
---|
34 | # Filter corpus=100-*-1, corpus=100-*-*+*+t0
|
---|
35 |
|
---|
36 | timings = timings.groupby('corpus-nstrs-tgt').get_group(100)
|
---|
37 | timings = timings.groupby('corpus-offset-instr').get_group('t0')
|
---|
38 |
|
---|
39 | # Emit in groups
|
---|
40 |
|
---|
41 | groupedSut = timings.groupby('sut')
|
---|
42 |
|
---|
43 | for sut, sgroup in groupedSut:
|
---|
44 | groupedOp = sgroup.groupby('operation')
|
---|
45 | for op,opPretty in prettyFieldNames.items():
|
---|
46 |
|
---|
47 | if op in groupedOp.groups:
|
---|
48 | tgtOpTimings = groupedOp.get_group(op)
|
---|
49 |
|
---|
50 | if sut in opPretty:
|
---|
51 |
|
---|
52 | sgroup_sorted = tgtOpTimings.sort_values(by='corpusMeanLenCharsAct')
|
---|
53 |
|
---|
54 | print('"{header}"'.format(header=opPretty[sut]))
|
---|
55 | text = sgroup_sorted[['corpusMeanLenCharsAct', 'op-duration-ns']].to_csv(header=False, index=False, sep='\t')
|
---|
56 | print(text)
|
---|
57 | print()
|
---|