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