summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-12-06 10:56:59 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2016-12-06 10:56:59 +0100
commit5255e2d5717dc7a265ca79404d387ef8abe8c004 (patch)
treeef246aecb2c2985e87c4b9a54d272270661d9039 /Makefile
parent847b501371c399d079af09ad6094d8f26ff2d0eb (diff)
Added 'make newbench'.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 13 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index b81efc8..1c3fc98 100644
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,7 @@ SITE=_site
SPECVERSION=$(shell perl -ne 'print $$1 if /^version: *([0-9.]+)/' $(SPEC))
FUZZCHARS?=2000000 # for fuzztest
BENCHDIR=bench
+BENCHSAMPLES=$(wildcard $(BENCHDIR)/samples/*.md)
BENCHFILE=$(BENCHDIR)/benchinput.md
ALLTESTS=alltests.md
NUMRUNS?=10
@@ -21,7 +22,7 @@ CLANG_CHECK?=clang-check
CLANG_FORMAT=clang-format -style llvm -sort-includes=0 -i
AFL_PATH?=/usr/local/bin
-.PHONY: all cmake_build leakcheck clean fuzztest test debug ubsan asan mingw archive bench format update-spec afl clang-check
+.PHONY: all cmake_build leakcheck clean fuzztest test debug ubsan asan mingw archive newbench bench format update-spec afl clang-check
all: cmake_build man/man3/cmark.3
@@ -166,6 +167,17 @@ bench: $(BENCHFILE)
done \
} 2>&1 | grep 'real' | awk '{print $$2}' | python3 'bench/stats.py'
+newbench:
+ for f in $(BENCHSAMPLES) ; do \
+ printf "%26s " `basename $$f` ; \
+ { for x in `seq 1 $(NUMRUNS)` ; do \
+ /usr/bin/env time -p $(PROG) </dev/null >/dev/null ; \
+ for x in `seq 1 200` ; do cat $$f ; done | \
+ /usr/bin/env time -p $(PROG) > /dev/null; \
+ done \
+ } 2>&1 | grep 'real' | awk '{print $$2}' | \
+ python3 'bench/stats.py'; done
+
format:
$(CLANG_FORMAT) src/*.c src/*.h api_test/*.c api_test/*.h