summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-11-17 10:14:24 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-11-17 10:14:24 -0800
commit67c5944b02d0dcabd8e928dbc997b41c03000b0b (patch)
tree56ab0e258f9bd2c8423f631f15d107aa21ca63a0 /Makefile
parent3fa0714153aa2242868d29a0c6e2816e561fbfbd (diff)
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.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 12 insertions, 9 deletions
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