aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-02-19 10:12:29 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2021-02-19 10:22:54 -0800
commitb745bf393801aedb3ab336b9974c88377dc5dd23 (patch)
treeaa280e46d4d647c20efed65982ef31fc90e38e10 /Makefile
parentd68bbae5520f0ad023b0d83b727e5e248ce26d67 (diff)
downloadpandoc-b745bf393801aedb3ab336b9974c88377dc5dd23.tar.gz
make bench: compare against a baseline, use datestamps for bench results.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 8 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 4f72ac9d4..134aedcb4 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,13 @@ pandoc=$(shell find dist -name pandoc -type f -exec ls -t {} \; | head -1)
SOURCEFILES?=$(shell git ls-tree -r master --name-only | grep "\.hs$$")
BRANCH?=master
COMMIT=$(shell git rev-parse --short HEAD)
+TIMESTAMP=$(shell date "+%Y%m%d_%H%M")
+LATESTBENCH=$(word 1,$(shell ls -t bench_*.csv))
+ifeq ($(LATESTBENCH),)
+BASELINE=
+else
+BASELINE=--baseline $(LATESTBENCH)
+endif
GHCOPTS=-fdiagnostics-color=always
WEBSITE=../../web/pandoc.org
REVISION?=1
@@ -39,7 +46,7 @@ ghcid:
ghcid -c "stack repl --flag 'pandoc:embed_data_files'"
bench:
- stack bench --benchmark-arguments='$(BENCHARGS) --csv bench-$(COMMIT).csv' --ghc-options '$(GHCOPTS)'
+ stack bench --benchmark-arguments='$(BENCHARGS) $(BASELINE) --csv bench_$(TIMESTAMP).csv' --ghc-options '$(GHCOPTS)'
weigh:
stack build --ghc-options '$(GHCOPTS)' pandoc:weigh-pandoc && stack exec weigh-pandoc