summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-11-15 21:17:16 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-11-15 21:18:48 -0800
commit9989d80d3b1e9d30c92034164108de4590b7ddb9 (patch)
tree00c75a18aa42dc2c4e315f0b1b38450b443c5f64 /Makefile
parent69d4e8b2a22c2d8ed4592e1bf3936a4a4d25f3a8 (diff)
Added a 'bench' target which does some basic stats on multiple runs.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 10 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 350f177..8cf34f6 100644
--- a/Makefile
+++ b/Makefile
@@ -13,7 +13,7 @@ PROG?=$(BUILDDIR)/src/cmark
BENCHINP?=README.md
JSMODULES=$(wildcard js/lib/*.js)
-.PHONY: all spec leakcheck clean fuzztest dingus upload jshint test testjs benchjs update-site upload-site check npm debug mingw tarball
+.PHONY: all spec leakcheck clean fuzztest dingus upload jshint test testjs benchjs update-site upload-site check npm debug mingw tarball bench
all: $(BUILDDIR)
@make -C $(BUILDDIR)
@@ -90,6 +90,15 @@ fuzztest:
/usr/bin/env time -p $(PROG) >/dev/null && rm fuzz-$$i.txt ; \
done } 2>&1 | grep 'user\|abnormally'
+bench:
+ make -C ${BUILDDIR} TIMER=1
+ { for x in `seq 1 100` ; do \
+ /usr/bin/env time -p ${PROG} progit.md >/dev/null ; \
+ done \
+ } 2>&1 | grep 'processing lines' | \
+ awk '{print $$3;}' | \
+ Rscript -e 'summary (as.numeric (readLines ("stdin")))'
+
operf: $(PROG)
operf $(PROG) <$(BENCHINP) >/dev/null