This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] benchtests/Makefile: Run the string benchmarks four times by default.
- From: Will Newton <will dot newton at linaro dot org>
- To: libc-alpha at sourceware dot org
- Cc: patches at linaro dot org
- Date: Wed, 04 Sep 2013 15:48:24 +0100
- Subject: [PATCH] benchtests/Makefile: Run the string benchmarks four times by default.
- Authentication-results: sourceware.org; auth=none
The string benchmarks can be affected by physical page placement, so
running them multiple times is required to account for this. Also
backup the results of the previous run like is done for the other
benchmarks.
ChangeLog:
2013-09-03 Will Newton <will.newton@linaro.org>
* benchtests/Makefile (BENCH_RUNS): New variable.
(bench-set): Run tests BENCH_RUNS times and backup old run
results.
---
benchtests/Makefile | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/benchtests/Makefile b/benchtests/Makefile
index 6037e5c..d72c98f 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -118,6 +118,11 @@ ifndef BENCH_DURATION
BENCH_DURATION := 10
endif
+# The default number of runs of a benchmark: 4.
+ifndef BENCH_RUNS
+BENCH_RUNS := 4
+endif
+
CPPFLAGS-nonlib += -DDURATION=$(BENCH_DURATION)
# Use clock_gettime to measure performance of functions. The default is to use
@@ -146,8 +151,15 @@ bench: bench-set bench-func
bench-set: $(binaries-benchset)
for run in $^; do \
- echo "Running $${run}"; \
- $(run-bench) > $${run}.out; \
+ for old in $${run}.*.out; do \
+ if [ -f $$old ]; then \
+ mv $$old $${old}.old; \
+ fi; \
+ done; \
+ for count in $$(seq 1 $(BENCH_RUNS)); do \
+ echo "Running $${run} ($${count})"; \
+ $(run-bench) > $${run}.$${count}.out; \
+ done; \
done
bench-func: $(binaries-bench)
--
1.8.1.4