From e61380fe6fdf5363f695b1ee153fafb85a9069e1 Mon Sep 17 00:00:00 2001
From: goksu <25721443+goeksu@users.noreply.github.com>
Date: Thu, 21 Sep 2023 15:34:38 +0300
Subject: [PATCH] [tohtml] running args again
python file is running by an OBJ_DIR directory.
---
benchmark.html | 30 ++++++++++++++++++++++++++++++
builds/testing.mk | 4 ++--
src/tools/ftbench/ftbench.c | 2 +-
src/tools/ftbench/src/tohtml.py | 9 +++++----
4 files changed, 38 insertions(+), 7 deletions(-)
create mode 100644 benchmark.html
diff --git a/benchmark.html b/benchmark.html
new file mode 100644
index 000000000..cea447f20
--- /dev/null
+++ b/benchmark.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+Freetype Benchmark Results
diff --git a/builds/testing.mk b/builds/testing.mk
index 412d8b4ff..438689303 100644
--- a/builds/testing.mk
+++ b/builds/testing.mk
@@ -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)"
####################################################################
diff --git a/src/tools/ftbench/ftbench.c b/src/tools/ftbench/ftbench.c
index 3522043d3..5ac3de9e2 100644
--- a/src/tools/ftbench/ftbench.c
+++ b/src/tools/ftbench/ftbench.c
@@ -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" );
diff --git a/src/tools/ftbench/src/tohtml.py b/src/tools/ftbench/src/tohtml.py
index e5749d19c..cd058acd4 100644
--- a/src/tools/ftbench/src/tohtml.py
+++ b/src/tools/ftbench/src/tohtml.py
@@ -30,10 +30,10 @@ CSS_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
)