... |
... |
@@ -51,7 +51,8 @@ def main(): |
51
|
51
|
write_to_html(html_file, "<h1>Freetype Benchmark Results</h1>\n")
|
52
|
52
|
|
53
|
53
|
baseline_info = parse_info_file(os.path.join(BASELINE_DIR, "info.txt"))
|
54
|
|
- benchmark_info = parse_info_file(os.path.join(BENCHMARK_DIR, "info.txt"))
|
|
54
|
+ benchmark_info = parse_info_file(
|
|
55
|
+ os.path.join(BENCHMARK_DIR, "info.txt"))
|
55
|
56
|
|
56
|
57
|
if baseline_info[1].strip() == benchmark_info[1].strip():
|
57
|
58
|
write_to_html(
|
... |
... |
@@ -67,8 +68,10 @@ def main(): |
67
|
68
|
# Generate results tables
|
68
|
69
|
for filename in os.listdir(BASELINE_DIR):
|
69
|
70
|
if filename.endswith(".txt") and not filename == "info.txt":
|
70
|
|
- baseline_results = read_file(os.path.join(BASELINE_DIR, filename))
|
71
|
|
- benchmark_results = read_file(os.path.join(BENCHMARK_DIR, filename))
|
|
71
|
+ baseline_results = read_file(
|
|
72
|
+ os.path.join(BASELINE_DIR, filename))
|
|
73
|
+ benchmark_results = read_file(
|
|
74
|
+ os.path.join(BENCHMARK_DIR, filename))
|
72
|
75
|
|
73
|
76
|
generate_results_table(
|
74
|
77
|
html_file, baseline_results, benchmark_results, filename
|
... |
... |
@@ -101,8 +104,8 @@ def generate_info_table(html_file, baseline_info, benchmark_info): |
101
|
104
|
write_to_html(html_file, "<h2>Info</h2>\n")
|
102
|
105
|
write_to_html(html_file, '<table border="1">\n')
|
103
|
106
|
write_to_html(
|
104
|
|
- html_file, "<tr><th>Info</th><th>Baseline</th><th>Benchmark</th></tr>\n"
|
105
|
|
- )
|
|
107
|
+ html_file,
|
|
108
|
+ "<tr><th>Info</th><th>Baseline</th><th>Benchmark</th></tr>\n")
|
106
|
109
|
info_list = ["Parameters", "Commit ID", "Commit Date", "Branch"]
|
107
|
110
|
for info, baseline_line, benchmark_line in zip(
|
108
|
111
|
info_list, baseline_info, benchmark_info
|
... |
... |
@@ -145,14 +148,17 @@ def generate_total_results_table(html_file, baseline_dir, benchmark_dir): |
145
|
148
|
for filename in os.listdir(baseline_dir):
|
146
|
149
|
if filename.endswith(".txt") and not filename == "info.txt":
|
147
|
150
|
baseline_results = read_file(os.path.join(baseline_dir, filename))
|
148
|
|
- benchmark_results = read_file(os.path.join(benchmark_dir, filename))
|
|
151
|
+ benchmark_results = read_file(
|
|
152
|
+ os.path.join(benchmark_dir, filename))
|
149
|
153
|
|
150
|
154
|
for baseline_line, benchmark_line in zip(
|
151
|
155
|
baseline_results, benchmark_results
|
152
|
156
|
):
|
153
|
157
|
if baseline_line.startswith("Total time:"):
|
154
|
|
- baseline_match = re.match(r"Total time: (\d+)s", baseline_line)
|
155
|
|
- benchmark_match = re.match(r"Total time: (\d+)s", benchmark_line)
|
|
158
|
+ baseline_match = re.match(
|
|
159
|
+ r"Total time: (\d+)s", baseline_line)
|
|
160
|
+ benchmark_match = re.match(
|
|
161
|
+ r"Total time: (\d+)s", benchmark_line)
|
156
|
162
|
|
157
|
163
|
if baseline_match and benchmark_match:
|
158
|
164
|
total_time += int(baseline_match.group(1))
|
... |
... |
@@ -160,8 +166,7 @@ def generate_total_results_table(html_file, baseline_dir, benchmark_dir): |
160
|
166
|
|
161
|
167
|
if baseline_line.startswith(" "):
|
162
|
168
|
baseline_match = re.match(
|
163
|
|
- r"\s+(.*?)\s+(\d+\.\d+)\s+microseconds\s+(\d+)\s", baseline_line
|
164
|
|
- )
|
|
169
|
+ r"\s+(.*?)\s+(\d+\.\d+)\s+microseconds\s+(\d+)\s", baseline_line)
|
165
|
170
|
benchmark_match = re.match(
|
166
|
171
|
r"\s+(.*?)\s+(\d+\.\d+)\s+microseconds\s+(\d+)\s",
|
167
|
172
|
benchmark_line,
|
... |
... |
@@ -235,7 +240,11 @@ def generate_total_results_table(html_file, baseline_dir, benchmark_dir): |
235
|
240
|
write_to_html(html_file, "</table>\n")
|
236
|
241
|
|
237
|
242
|
|
238
|
|
-def generate_results_table(html_file, baseline_results, benchmark_results, filename):
|
|
243
|
+def generate_results_table(
|
|
244
|
+ html_file,
|
|
245
|
+ baseline_results,
|
|
246
|
+ benchmark_results,
|
|
247
|
+ filename):
|
239
|
248
|
"""Prepare results table for html"""
|
240
|
249
|
fontname = [
|
241
|
250
|
line.split("/")[-1].strip("'")[:-2]
|
... |
... |
@@ -255,7 +264,8 @@ def generate_results_table(html_file, baseline_results, benchmark_results, filen |
255
|
264
|
|
256
|
265
|
total_n = total_time = 0
|
257
|
266
|
|
258
|
|
- for baseline_line, benchmark_line in zip(baseline_results, benchmark_results):
|
|
267
|
+ for baseline_line, benchmark_line in zip(
|
|
268
|
+ baseline_results, benchmark_results):
|
259
|
269
|
if baseline_line.startswith("Total time:"):
|
260
|
270
|
baseline_match = re.match(r"Total time: (\d+)s", baseline_line)
|
261
|
271
|
benchmark_match = re.match(r"Total time: (\d+)s", benchmark_line)
|
... |
... |
@@ -266,12 +276,12 @@ def generate_results_table(html_file, baseline_results, benchmark_results, filen |
266
|
276
|
|
267
|
277
|
if baseline_line.startswith(" "):
|
268
|
278
|
baseline_match = re.match(
|
269
|
|
- r"\s+(.*?)\s+(\d+\.\d+)\s+microseconds\s+(\d+)\s", baseline_line
|
270
|
|
- )
|
|
279
|
+ r"\s+(.*?)\s+(\d+\.\d+)\s+microseconds\s+(\d+)\s",
|
|
280
|
+ baseline_line)
|
271
|
281
|
|
272
|
282
|
benchmark_match = re.match(
|
273
|
|
- r"\s+(.*?)\s+(\d+\.\d+)\s+microseconds\s+(\d+)\s", benchmark_line
|
274
|
|
- )
|
|
283
|
+ r"\s+(.*?)\s+(\d+\.\d+)\s+microseconds\s+(\d+)\s",
|
|
284
|
+ benchmark_line)
|
275
|
285
|
|
276
|
286
|
if baseline_match and benchmark_match:
|
277
|
287
|
baseline_value = float(baseline_match.group(2))
|