[tohtml] running args again

python file is running by an OBJ_DIR directory.
This commit is contained in:
goksu 2023-09-21 15:34:38 +03:00
parent dcfebc9a07
commit e61380fe6f
No known key found for this signature in database
4 changed files with 38 additions and 7 deletions

30
benchmark.html Normal file
View File

@ -0,0 +1,30 @@
<html>
<head>
<style>
table {
table-layout: fixed;
}
th, td {
padding: 3px;
text-align: center;
}
th {
background-color: #ccc;
color: black;
}
.warning{
color: red;
}
.col1 {
background-color: #eee;
}
.highlight {
background-color: #0a0;
}
</style>
</head>
<body>
<h1>Freetype Benchmark Results</h1>

View File

@ -16,7 +16,7 @@ HTMLCREATOR = $(OBJ_DIR)/tohtml.py
HTMLFILE = $(OBJ_DIR)/benchmark.html
# Define flags, create default values in case of not inputted by user.
FTBENCH_FLAG ?= -c 1000 -w 100
FTBENCH_FLAG ?=
# Define all test fonts in the fonts folder.
BASELINE = $(addprefix $(BASELINE_DIR), $(notdir $(FONTS:.ttf=.txt)))
@ -157,7 +157,7 @@ benchmark: $(FTBENCH_BIN) $(BENCHMARK_DIR) copy-html-script
printf "\nProcessing %d%%..." $$percent; \
$(FTBENCH_BIN) $(FTBENCH_FLAG) "$$font" > $(BENCHMARK_DIR)$$(basename $$font .ttf).txt; \
done
@$(PYTHON) $(HTMLCREATOR)
@$(PYTHON) $(HTMLCREATOR) $(OBJ_DIR)
@echo "Benchmark results created in file: $(HTMLFILE)"
####################################################################

View File

@ -304,7 +304,7 @@
}
if ( done )
printf( "%10.3f us/op %10d done\n",
printf( "%10.3f microseconds %10d done\n",
TIMER_GET( &timer ) / (double)done, done );
else
printf( "no error-free calls\n" );

View File

@ -30,10 +30,10 @@ CSS_STYLE = """
}
</style>
"""
BASELINE_DIR = "baseline"
BENCHMARK_DIR = "benchmark"
BENCHMARK_HTML = "benchmark.html"
OBJ_DIR = sys.argv[1]
BASELINE_DIR = os.path.join(OBJ_DIR, "baseline")
BENCHMARK_DIR = os.path.join(OBJ_DIR, "benchmark")
BENCHMARK_HTML = os.path.join(OBJ_DIR, "benchmark.html")
FONT_COUNT = 5
@ -268,6 +268,7 @@ def generate_results_table(html_file, baseline_results, benchmark_results, filen
baseline_match = re.match(
r"\s+(.*?)\s+(\d+\.\d+)\s+microseconds\s+(\d+)\s", baseline_line
)
benchmark_match = re.match(
r"\s+(.*?)\s+(\d+\.\d+)\s+microseconds\s+(\d+)\s", benchmark_line
)