From 67c5944b02d0dcabd8e928dbc997b41c03000b0b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 17 Nov 2014 10:14:24 -0800 Subject: Better benchmark. 'make bench' runs the program 20 times against a file composed of 10 copies of Pro Git (about 5MB in all). It then does statistics on the results. We run it with high priority to get more consistent timings. --- Makefile | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 8714093..9e564e9 100644 --- a/Makefile +++ b/Makefile @@ -62,7 +62,7 @@ archive: spec.html $(BUILDDIR) echo "Created $(TARBALL) and $(ZIPARCHIVE)." clean: - rm -rf $(BUILDDIR) $(MINGW_BUILDDIR) $(MINGW_INSTALLDIR) $(TARBALL) $(ZIPARCHIVE) $(PKGDIR) + rm -rf $(BUILDDIR) $(MINGW_BUILDDIR) $(MINGW_INSTALLDIR) $(TARBALL) $(ZIPARCHIVE) $(PKGDIR) benchmark.md $(PROG): all @@ -114,14 +114,17 @@ fuzztest: /usr/bin/env time -p $(PROG) >/dev/null && rm fuzz-$$i.txt ; \ done } 2>&1 | grep 'user\|abnormally' -bench: - # First build with TIMER=1 - { for x in `seq 1 100` ; do \ - /usr/bin/env time -p ${PROG} progit.md >/dev/null ; \ - done \ - } 2>&1 | grep ${BENCHPATT} | \ - awk '{print $$3;}' | \ - Rscript -e 'summary (as.numeric (readLines ("stdin")))' +# for benchmarking +benchmark.md: progit.md + for x in `seq 1 10` ; do cat $< >> $@; done + +bench: benchmark.md + { for x in `seq 1 20` ; do \ + sudo chrt -f 99 /usr/bin/env time -p ${PROG} $< >/dev/null ; \ + done \ + } 2>&1 | tee rawdata | grep 'user' |\ + awk '{print $$2}' | \ + python3 'bench/stats.py' operf: $(PROG) operf $(PROG) <$(BENCHINP) >/dev/null -- cgit v1.2.3