cmark

My personal build of CMark ✏️

Commit
9989d80d3b1e9d30c92034164108de4590b7ddb9
Parent
69d4e8b2a22c2d8ed4592e1bf3936a4a4d25f3a8
Author
John MacFarlane <jgm@berkeley.edu>
Date

Added a 'bench' target which does some basic stats on multiple runs.

Diffstat

1 file changed, 10 insertions, 1 deletion

Status File Name N° Changes Insertions Deletions
Modified Makefile 11 10 1
diff --git 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