cmark

Unnamed repository; edit this file 'description' to name the repository.

commit 0655c79138d3115f12b08fb4d38d164c3b8482eb
parent 01954cef95435ec78d12e2e62defe25d5032a087
Author: John MacFarlane <jgm@berkeley.edu>
Date:   Mon, 17 Nov 2014 17:57:42 -0800

More 'make bench' improvements.

Diffstat:
MMakefile | 9++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
@@ -12,6 +12,7 @@ ZIPARCHIVE?=cmark-$(SPECVERSION).zip
 FUZZCHARS?=2000000  # for fuzztest
 BENCHDIR=bench
 BENCHFILE=$(BENCHDIR)/benchinput.md
+NUMRUNS?=10
 PROG?=$(BUILDDIR)/src/cmark
 BENCHINP?=README.md
 JSMODULES=$(wildcard js/lib/*.js)
@@ -117,7 +118,7 @@ fuzztest:
 
 # for benchmarking
 $(BENCHFILE): progit/progit.md
-	-rm $@; for x in `seq 1 40` ; do cat $< >> $@; done
+	-rm $@; for x in `seq 1 20` ; do cat $< >> $@; done
 
 progit:
 	git clone https://github.com/progit/progit.git
@@ -127,12 +128,10 @@ progit/progit.md: progit
 
 bench: $(BENCHFILE)
 	{ sudo renice 99 $$$$; \
-	  for x in `seq 1 10` ; do \
+	  for x in `seq 1 $(NUMRUNS)` ; do \
 	  /usr/bin/env time -p ${PROG} $< >/dev/null ; \
 		  done \
-	} 2>&1  | grep 'real' |\
-	          awk '{print $$2}' | \
-		  python3 'bench/stats.py'
+	} 2>&1  | grep 'real' | awk '{print $$2}' | python3 'bench/stats.py'
 
 operf: $(PROG)
 	operf $(PROG) <$(BENCHINP) >/dev/null