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 | # re: apparent cherrypicking
|
---|
21 | # The system's response to the liveness threshold is not smooth.
|
---|
22 | # The system only uses the threshold to decide whether it will double the text heap again or not.
|
---|
23 | # The system's speed for a given string size in a given amount of memory is not affected by the specific value of the liveness threshold.
|
---|
24 | # Goals with this selection are
|
---|
25 | # - showing one speed result per <string size, memory usage amount>
|
---|
26 | # - cropping diminishing or negative returns for large memory sizes
|
---|
27 | # - diminishing is obvious, already shown past chosen sweet spot in this selection
|
---|
28 | # - negative caused by overflowing llc, not relevant to sting impl
|
---|
29 | favSizes = {20:[-1.0, 0.05, 0.1, 0.2, 0.5, 0.9],
|
---|
30 | 50:[-1.0, 0.05, 0.1, 0.2, 0.5, 0.9],
|
---|
31 | 100:[-1.0, 0.1, 0.2, 0.5, 0.9],
|
---|
32 | 200:[-1.0, 0.1, 0.2, 0.5, 0.9],
|
---|
33 | 500:[-1.0, 0.4, 0.9, 0.98]}
|
---|
34 |
|
---|
35 | defaultExpansions = [-1, 0.2]
|
---|
36 |
|
---|
37 | cfatimings = loadParseTimingData('result-allocate-speed-cfa.csv',
|
---|
38 | xClasNames=['expansion'], xClasDtypes={'expansion':'Float64'},
|
---|
39 | xFactNames=['topIters'], xFactDtypes={'topIters':np.int64})
|
---|
40 |
|
---|
41 | cfasizings = loadParseSizingData('result-allocate-space-cfa.ssv', xClasNames=['expansion'], xClasDtypes={'expansion':'Float64'})
|
---|
42 |
|
---|
43 | stltimings = loadParseTimingData('result-allocate-speed-stl.csv',
|
---|
44 | xClasNames=['expansion'], xClasDtypes={'expansion':'Float64'},
|
---|
45 | xFactNames=['topIters'], xFactDtypes={'topIters':np.int64})
|
---|
46 |
|
---|
47 | stlsizings = loadParseSizingData('result-allocate-space-stl.ssv', xClasNames=['expansion'], xClasDtypes={'expansion':'Float64'})
|
---|
48 |
|
---|
49 | timings = pd.concat([cfatimings, stltimings])
|
---|
50 | sizings = pd.concat([cfasizings, stlsizings])
|
---|
51 |
|
---|
52 | combined = pd.merge(
|
---|
53 | left=timings,
|
---|
54 | right=sizings[['sut', 'corpus','expansion','hw_cur_req_mem(B)']],
|
---|
55 | on=['sut', 'corpus','expansion']
|
---|
56 | )
|
---|
57 |
|
---|
58 | combined['is-default'] = np.isin(combined['expansion'], defaultExpansions).astype(int)
|
---|
59 |
|
---|
60 | # print ('!!')
|
---|
61 | # print(combined)
|
---|
62 |
|
---|
63 |
|
---|
64 | # Emit
|
---|
65 |
|
---|
66 | # First, for the CFA curves
|
---|
67 | sut = "cfa"
|
---|
68 | sutGroup = combined.groupby('sut-platform').get_group(sut)
|
---|
69 |
|
---|
70 | groupedSize = sutGroup.groupby('corpus-meanlen')
|
---|
71 |
|
---|
72 | for sz, szgroup in groupedSize:
|
---|
73 |
|
---|
74 | if sz in favSizes.keys():
|
---|
75 | szgroup_sorted = szgroup.sort_values(by='expansion')
|
---|
76 |
|
---|
77 | print('"{sut}, len={len}"'.format(sut=sut, len=sz))
|
---|
78 | # print(szgroup_sorted) ##
|
---|
79 | # print(szgroup_sorted['expansion'], 'isin', favSizes[sz]) ##
|
---|
80 | favoured = szgroup_sorted.loc[szgroup_sorted['expansion'].isin(favSizes[sz])]
|
---|
81 | # print('!') ##
|
---|
82 | # print(favoured) ##
|
---|
83 | text = favoured[['expansion', 'op-duration-ns', 'hw_cur_req_mem(B)', 'is-default']].to_csv(header=False, index=False, sep='\t')
|
---|
84 | print(text)
|
---|
85 | print()
|
---|
86 |
|
---|
87 | # Again, for the STL-comparisons, default expansion only
|
---|
88 |
|
---|
89 | atDefaults = combined.groupby('is-default').get_group(1)
|
---|
90 |
|
---|
91 | for sz, szgroup in atDefaults.groupby('corpus-meanlen'):
|
---|
92 |
|
---|
93 | if sz in favSizes.keys():
|
---|
94 | print(sz)
|
---|
95 | text = szgroup[['expansion', 'op-duration-ns', 'hw_cur_req_mem(B)', 'sut-platform']].to_csv(header=False, index=False, sep='\t')
|
---|
96 | print(text)
|
---|
97 | print()
|
---|