little fixes

This commit is contained in:
goksu 2023-08-01 17:37:55 +03:00
parent 5025ea6e49
commit fae5e8c941
No known key found for this signature in database
2 changed files with 10 additions and 9 deletions

View File

@ -3,7 +3,7 @@ FTBENCH_DIR = $(TOP_DIR)/src/tools/ftbench
FTBENCH_SRC = $(FTBENCH_DIR)/ftbench.c
FTBENCH_OBJ = $(OBJ_DIR)/bench.$(SO)
FTBENCH_BIN = $(OBJ_DIR)/bench$E
FTBENCH_FLAG ?= -c 500
FTBENCH_FLAG ?= -c 100
INCLUDES = $(TOP_DIR)/include
FONTS = $(wildcard $(FTBENCH_DIR)/fonts/*.ttf)
BASELINE_DIR = $(OBJ_DIR)/baseline/
@ -100,7 +100,7 @@ baseline: $(FTBENCH_BIN) $(BASELINE_DIR)
printf "\rProcessing %d%%..." $$percent; \
$(FTBENCH_BIN) $(FTBENCH_FLAG) "$$font" > $(BASELINE_DIR)$$(basename $$font .ttf).txt; \
done
@echo "\nBaseline created."
@echo "Baseline created."
# Benchmark and compare to baseline
.PHONY: benchmark
@ -121,7 +121,7 @@ benchmark: $(FTBENCH_BIN) $(BENCHMARK_DIR)
$(FTBENCH_BIN) $(FTBENCH_FLAG) "$$font" > $(BENCHMARK_DIR)$$(basename $$font .ttf).txt; \
done
@$(PYTHON) $(HTMLCREATOR) $(OBJ_DIR)
@echo "\nBenchmark created."
@echo "Benchmark results created in file: $(HTMLFILE)"
.PHONY: clean-benchmark
clean-benchmark:

View File

@ -42,6 +42,7 @@ def main():
write_to_html(html_file, "<html>\n<head>\n")
write_to_html(html_file, CSS_STYLE)
write_to_html(html_file, "</head>\n<body>\n")
write_to_html(html_file, "<h1>Freetype Benchmark Results</h1>\n")
baseline_info = parse_info_file(os.path.join(BASELINE_DIR, "info.txt"))
benchmark_info = parse_info_file(os.path.join(BENCHMARK_DIR, "info.txt"))
@ -49,7 +50,7 @@ def main():
if baseline_info[1].strip() == benchmark_info[1].strip():
write_to_html(
html_file,
'<h2 class="warning">Warning: Baseline and Benchmark have the same commit ID</h2>\n',
'<h2 class="warning">Warning: Baseline and Benchmark have the same commit ID!</h2>\n',
)
generate_info_table(html_file, baseline_info, benchmark_info)
@ -63,7 +64,7 @@ def main():
generate_results_table(
html_file, baseline_results, benchmark_results, filename
)
write_to_html(html_file, "<center>Freetype Benchmark</center>\n")
write_to_html(html_file, "</body>\n</html>\n")
def write_to_html(html_file, content):
@ -102,7 +103,7 @@ def generate_info_table(html_file, baseline_info, benchmark_info):
),
)
write_to_html(html_file, "</table><br/>")
write_to_html(html_file, "*Smaller values mean faster operation<br/>\n")
write_to_html(html_file, "* Smaller values mean faster operation<br/>\n")
def generate_results_table(html_file, baseline_results, benchmark_results, filename):
@ -118,8 +119,8 @@ def generate_results_table(html_file, baseline_results, benchmark_results, filen
write_to_html(
html_file,
'<tr><th>Test</th><th>N</th>\
<th><a href="{}.txt">Baseline</a> (ms)</th>\
<th><a href="{}.txt">Benchmark</a> (ms)</th>\
<th>* <a href="{}.txt">Baseline</a> (ms)</th>\
<th>* <a href="{}.txt">Benchmark</a> (ms)</th>\
<th>Difference (%)</th></tr>\n'.format(
os.path.join(BASELINE_DIR, filename[:-4]),
os.path.join(BENCHMARK_DIR, filename[:-4]),
@ -151,7 +152,7 @@ def generate_results_table(html_file, baseline_results, benchmark_results, filen
n = (
baseline_n
if baseline_n == benchmark_n
else baseline_n + " / " + benchmark_n
else baseline_n + " | " + benchmark_n
)
total_n += int(baseline_n)