1 | # Read thesis-append-pbv.csv
|
---|
2 | # Output for string-graph-peq-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 | sizes_i_want = [50, 200] # [20, 50, 100, 200]
|
---|
21 |
|
---|
22 | # assume CFA threshold only run at default value
|
---|
23 |
|
---|
24 | cfatimings = loadParseTimingData('result-allocate-speed-cfa.csv',
|
---|
25 | xClasNames=['expansion'], xClasDtypes={'expansion':'Float64'},
|
---|
26 | xFactNames=['topIters'], xFactDtypes={'topIters':np.int64})
|
---|
27 |
|
---|
28 | cfaattribs = loadParseAttribData('result-allocate-attrib-cfa.ssv')
|
---|
29 |
|
---|
30 | stltimings = loadParseTimingData('result-allocate-speed-stl.csv',
|
---|
31 | xClasNames=['expansion'], xClasDtypes={'expansion':'Float64'},
|
---|
32 | xFactNames=['topIters'], xFactDtypes={'topIters':np.int64})
|
---|
33 |
|
---|
34 | stlattribs = loadParseAttribData('result-allocate-attrib-stl.ssv')
|
---|
35 |
|
---|
36 | timings = pd.concat([cfatimings, stltimings])
|
---|
37 | attribs = pd.concat([cfaattribs, stlattribs])
|
---|
38 |
|
---|
39 | combined = pd.merge(
|
---|
40 | left=timings[['sut-platform', 'corpus-meanlen','expansion', 'op-duration-ns']],
|
---|
41 | right=attribs[['sut-platform', 'corpus-meanlen','expansion', 'category', 'fraction']],
|
---|
42 | on=['sut-platform', 'corpus-meanlen','expansion']
|
---|
43 | )
|
---|
44 |
|
---|
45 | combined['cat-duration-ns'] = combined['op-duration-ns'] * combined['fraction']
|
---|
46 | combined.drop(columns=['expansion', 'op-duration-ns', 'fraction'], inplace=True)
|
---|
47 |
|
---|
48 | pvt = combined.pivot( columns='category', values='cat-duration-ns', index=['corpus-meanlen', 'sut-platform'] )
|
---|
49 |
|
---|
50 | desired_dcol_order = ["ctor-dtor", "gc", "malloc-free", "text-import", "harness-leaf", "other"]
|
---|
51 | pvt = pvt[desired_dcol_order]
|
---|
52 |
|
---|
53 | filtered = pvt.loc[pvt.index.get_level_values('corpus-meanlen').isin(sizes_i_want)]
|
---|
54 |
|
---|
55 | print(filtered.to_csv(header=True, index=True, sep='\t', na_rep="0"))
|
---|
56 |
|
---|