Skip to content

Commit 8fc114c

Browse files
authored
RQ4 Cleanup (gousiosg#28)
* Updated rq4.tex * Removed unnecessary mph-table properties in genResults * Updated rq4.tex * Removed unnecessary mph-table properties in genResults * Removed unnecessary mph-table properties in genResults * Removed unnecessary mph-table properties in genResults * Removed unnecessary mph-table properties in genResults * Removed unnecessary mph-table properties in genResults * Resolved bug in mph-table results gen * Updated rq4 w/ proper index
1 parent 18afb6b commit 8fc114c

File tree

2 files changed

+38
-43
lines changed

2 files changed

+38
-43
lines changed

artifacts/experiments/RQ4/generateResults.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,7 @@
1414
CALC_NAMES = ['Vanilla', 'Improved', 'Overhead']
1515

1616
propertyShortNames = {
17-
"TestSmartByteSerializer#canRoundTripBytes": 'byte',
18-
"TestSmartIntegerSerializer#canRoundTripIntegers": 'int',
1917
"TestSmartListSerializer#canRoundTripSerializableLists": 'list',
20-
"TestSmartLongSerializer#canRoundTripLongs": 'long',
21-
"TestSmartOptionalSerializer#canRoundTripPresentOptionals": 'optionals',
22-
"TestSmartPairSerializer#canRoundTripPairs": 'pair',
23-
"TestSmartShortSerializer#canRoundTripShort": 'short',
24-
"TestSmartStringSerializer#canRoundTripStrings": 'string',
2518
"TestSmartListSerializer#canRoundTripSerializableListsWithGenerator": 'list*',
2619
"GenTestFormat#dataRoundTrip": 'data',
2720
"GenTestFormat#messageRoundTrip": 'message',
@@ -41,7 +34,6 @@
4134
"X509ResourceCertificateParentChildValidatorTest#validParentChildOverClaimingLooseValidation": 'loose'
4235
}
4336

44-
row_count = 1
4537

4638
def obtain_stats_directories(results_directory: str) -> list[str]:
4739
directory_tree = [x for x in os.walk(results_directory)] # os.walk returns a tuple with structure (directory, subdirectories, files)
@@ -71,17 +63,27 @@ def evaluate_directories(project_name: str, results_directory: str, directories:
7163
directory_path = results_directory + directory + "/"
7264
directory_tree = [x[2] for x in os.walk(directory_path)]
7365
valid_htmls = [x for x in directory_tree[0] if 'html' in x]
74-
directory_stats = retrieve_time_elapsed(directory_path=directory_path, valid_htmls=valid_htmls)
66+
directory_stats = retrieve_time_elapsed(project_name=project_name, directory_path=directory_path, valid_htmls=valid_htmls)
7567
project_iteration = project_name + " - " + str(iteration)
7668
final_stats[project_iteration] = directory_stats
7769
iteration += 1
7870
return final_stats
7971

80-
def retrieve_time_elapsed(directory_path: str, valid_htmls: list[str]) -> dict[str, str]:
72+
73+
def retrieve_time_elapsed(project_name: str, directory_path: str, valid_htmls: list[str]) -> dict[str, str]:
8174
times_elapsed_dict = {}
8275
for html_file in valid_htmls:
8376
property_name = html_file.replace(".html", "")
77+
if property_name not in propertyShortNames:
78+
continue
8479
property_short_name = propertyShortNames[property_name]
80+
if property_short_name == 'list*' and project_name == 'mph-table-fixed':
81+
property_short_name = 'list'
82+
elif property_short_name == 'list' and project_name == 'mph-table-fixed':
83+
continue
84+
elif property_short_name == 'list*':
85+
print(project_name)
86+
continue
8587
file_path = directory_path + html_file
8688
with open(file_path) as f:
8789
contents = f.read()
@@ -122,7 +124,7 @@ def generate_project_report(project_name: str, final_stats: dict[str, str], fina
122124
return final_report_dict
123125

124126

125-
def generate_project_df(final_stats: dict[str, str], final_fixed_stats: dict[str, str]) -> pd.DataFrame():
127+
def generate_project_df(final_stats: dict[str, str], final_fixed_stats: dict[str, str], row_count: int) -> (pd.DataFrame(), int):
126128
vanilla_df = pd.DataFrame()
127129
vanilla_df['Property'] = [key for key in final_stats.keys()]
128130
vanilla_df['Vanilla'] = [val for val in final_stats.values()]
@@ -133,13 +135,14 @@ def generate_project_df(final_stats: dict[str, str], final_fixed_stats: dict[str
133135

134136
merged_df = pd.merge(vanilla_df, improved_df, how='outer', on='Property')
135137
merged_df['N'] = pd.RangeIndex(start=row_count, stop=len(merged_df.index) + row_count)
136-
138+
row_count += len(merged_df.index)
137139
final_df = merged_df[['N', 'Property', 'Vanilla', 'Improved']]
138-
return final_df
140+
return final_df, row_count
139141

140142

141143
def main():
142144
final_dataset = {}
145+
row_count = 1
143146
for project_name in PROJECTS:
144147
fixed_project_name = project_name + "-fixed"
145148
results_directory = BASE_RESULT_DIR + project_name + "/"
@@ -157,7 +160,7 @@ def main():
157160
# obtain mean/st dev
158161
final_stats = generate_report_stats(stat_values=raw_stats)
159162
final_fixed_stats = generate_report_stats(stat_values=fixed_raw_stats)
160-
project_df = generate_project_df(final_stats=final_stats, final_fixed_stats=final_fixed_stats)
163+
project_df, row_count = generate_project_df(final_stats=final_stats, final_fixed_stats=final_fixed_stats, row_count=row_count)
161164
final_dataset[project_name] = project_df
162165

163166

artifacts/output/rq4.tex

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,34 @@
33
\hline
44
\multicolumn{5}{c}{convex} \\
55
\hline
6-
1 & message & 45.22 ± 3.36 & 42.80 ± 2.70 & 0.95 \\
7-
2 & data & 53.02 ± 1.99 & 53.92 ± 0.00 & 1.02 \\
8-
3 & primitive & 48.52 ± 0.88 & 50.12 ± 0.00 & 1.03 \\
9-
\textbf{} & \textbf{Average} & \textbf{48.92} & \textbf{48.95} & \textbf{1.00} \\
6+
1 & data & 39.01 ± 0.58 & nan & nan \\
7+
2 & message & 33.25 ± 2.40 & 30.88 ± 0.64 & 0.93 \\
8+
3 & primitive & 35.77 ± 0.61 & nan & nan \\
9+
\textbf{} & \textbf{Average} & \textbf{36.01} & \textbf{30.88} & \textbf{0.93} \\
1010
\hline
1111
\multicolumn{5}{c}{jflex} \\
1212
\hline
13-
1 & remove & 41.50 ± 6.41 & 31.56 ± 5.16 & 0.76 \\
14-
2 & addSingleton & 44.89 ± 0.77 & 51.57 ± 0.79 & 1.15 \\
15-
3 & contains & 43.82 ± 2.12 & 42.61 ± 1.68 & 0.97 \\
16-
4 & addSet & 44.56 ± 0.94 & 52.82 ± 0.87 & 1.19 \\
17-
5 & add & 43.06 ± 1.84 & 43.10 ± 1.80 & 1.00 \\
18-
6 & addString & 44.93 ± 1.64 & 51.53 ± 1.59 & 1.15 \\
19-
7 & addSingle & 44.40 ± 2.21 & 53.14 ± 1.53 & 1.20 \\
20-
\textbf{} & \textbf{Average} & \textbf{43.88} & \textbf{46.62} & \textbf{1.06} \\
13+
4 & addSingleton & 34.35 ± 0.59 & 42.69 ± 0.67 & 1.24 \\
14+
5 & contains & 34.33 ± 0.62 & 34.36 ± 0.57 & 1.00 \\
15+
6 & addSet & 34.47 ± 0.48 & 44.64 ± 0.98 & 1.30 \\
16+
7 & add & 34.58 ± 0.48 & 34.20 ± 0.77 & 0.99 \\
17+
8 & remove & 34.50 ± 1.02 & 24.36 ± 0.40 & 0.71 \\
18+
9 & addString & 34.65 ± 0.88 & 43.03 ± 0.63 & 1.24 \\
19+
10 & addSingle & 34.42 ± 0.55 & 45.21 ± 0.70 & 1.31 \\
20+
\textbf{} & \textbf{Average} & \textbf{34.47} & \textbf{38.36} & \textbf{1.11} \\
2121
\hline
2222
\multicolumn{5}{c}{mph-table} \\
2323
\hline
24-
1 & list & 13.49 ± 0.98 & 13.19 ± 0.94 & 0.98 \\
25-
2 & optionals & 12.75 ± 0.76 & 13.17 ± 1.08 & 1.03 \\
26-
3 & short & 12.68 ± 0.67 & 13.16 ± 0.58 & 1.04 \\
27-
4 & int & 13.09 ± 0.81 & 12.79 ± 1.00 & 0.98 \\
28-
5 & pair & 12.76 ± 0.81 & 13.16 ± 1.09 & 1.03 \\
29-
6 & byte & 12.57 ± 0.79 & 12.85 ± 1.04 & 1.02 \\
30-
7 & long & 12.80 ± 0.75 & 13.04 ± 0.91 & 1.02 \\
31-
8 & string & 12.73 ± 0.60 & 12.99 ± 0.97 & 1.02 \\
32-
9 & list* & nan & 27.19 ± 3.60 & nan \\
33-
\textbf{} & \textbf{Average} & \textbf{12.86} & \textbf{14.62} & \textbf{1.01} \\
24+
11 & list & 10.15 ± 0.31 & 20.30 ± 2.36 & 2.00 \\
25+
\textbf{} & \textbf{Average} & \textbf{10.15} & \textbf{20.30} & \textbf{2.00} \\
3426
\hline
3527
\multicolumn{5}{c}{rpki-commons} \\
3628
\hline
37-
1 & claiming & 25.33 ± 2.37 & nan & nan \\
38-
2 & aspa & 23.42 ± 1.72 & nan & nan \\
39-
3 & resources & 24.18 ± 1.60 & 26.14 ± 0.28 & 1.08 \\
40-
4 & roa & 24.29 ± 3.24 & nan & nan \\
41-
5 & manifest & 23.41 ± 2.44 & nan & nan \\
42-
6 & loose & 25.48 ± 2.62 & nan & nan \\
43-
\textbf{} & \textbf{Average} & \textbf{24.35} & \textbf{26.14} & \textbf{1.08} \\
29+
12 & claiming & 24.73 ± 0.55 & nan & nan \\
30+
13 & aspa & 22.98 ± 0.46 & nan & nan \\
31+
14 & resources & 23.39 ± 0.44 & 26.14 ± 0.40 & 1.12 \\
32+
15 & roa & 22.61 ± 0.62 & nan & nan \\
33+
16 & manifest & 22.62 ± 0.53 & nan & nan \\
34+
17 & loose & 24.65 ± 0.50 & nan & nan \\
35+
\textbf{} & \textbf{Average} & \textbf{23.50} & \textbf{26.14} & \textbf{1.12} \\
4436
\end{tabular}

0 commit comments

Comments
 (0)