Fix: makefile benachmarks

This commit is contained in:
Dorian Zedler 2022-07-20 12:19:58 +02:00
parent 874ded8084
commit 81bcf3ea87
Signed by: dorian
GPG key ID: 989DE36109AFA354

View file

@ -5,7 +5,7 @@ OBJ = ${subst src,build,${SRC:.c=.o}}
CC = gcc
CFLAGS = -Ilib -ggdb -std=c11 -g -Wall -Wextra -no-pie -O3
LDFLAGS = -pthread
TESTFILES = t/1 t/10 t/100 #t/1000 t/2000 t/5000 t/10000
TESTFILES = t/10000 t/1 t/10 t/100 t/1000 #t/2000 t/5000 t/10000
TESTFILES_SIZES = ${subst t/,,${TESTFILES}}
all: md2
@ -36,20 +36,19 @@ t/%:
@echo "=== done ==="
@echo
benchmarks.csv: ${TESTFILES}
@echo "" > $@
benchmarks.csv: md2 ${TESTFILES}
@rm -f $@
@for i in 0 2 3; do \
echo ;\
echo "=== Testing implementation $$i ===";\
for t in $(TESTFILES_SIZES); do \
echo -n "- with $${t}MB ... "; \
if ! r=$$(./md2 t/$${t} -B1 -V1); then \
if ! rr=$$(./md2 t/$${t} -B1 -V$${i}); then \
echo; \
echo "ERROR!"; \
exit 1; \
fi; \
r=$$(echo $$r | grep "cycles took" | sed 's/ seconds//g' | sed 's/took /\n/g' | tail -1) \
echo $$?; \
r=$$(echo $$rr | xargs | sed -e 's/.*took \(.*\) seconds.*/\1/'); \
echo "$${r}s"; \
echo "$${i};$${t};$${r}" >> $@; \
done; \
@ -57,8 +56,6 @@ benchmarks.csv: ${TESTFILES}
echo;\
done
benchmarks: benchmarks.csv
tests: md2
.PHONY: all clean help
.PHONY: all clean help benchmarks