aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-03-17 13:34:17 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2021-03-17 13:34:17 -0700
commitc6e5cf2e7472ab872a537327a03ef9eb9fcef2a1 (patch)
tree4f6b922045aa8fa7b48c35ed96aa7f175cf9062f /Makefile
parent84836719aabe055b12d8444f8a6e70c13336f614 (diff)
downloadpandoc-c6e5cf2e7472ab872a537327a03ef9eb9fcef2a1.tar.gz
Benchmark improvements.
* Build `+RTS -A256m -RTS` into default ghc-options for benchmark, so we don't have to specify this separately on the command line. This is necessary to get accurate benchmark results; otherwise we are largely measuring garbage collecting, some not related to the current benchmark. * Switch back from gauge to tasty-bench. * Allow specifying BASELINE file in 'make bench' for comparison (otherwise the latest is chosen by default). * Remove obsolete reference to weigh-pandoc from CONTRIBUTING.md. * Remove `-Rghc-timing` from 'make bench'.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 7 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 0ef0406f8..5e5bc7c51 100644
--- a/Makefile
+++ b/Makefile
@@ -7,21 +7,19 @@ DOCKERIMAGE=registry.gitlab.b-data.ch/ghc/ghc4pandoc:8.10.4
COMMIT=$(shell git rev-parse --short HEAD)
TIMESTAMP=$(shell date "+%Y%m%d_%H%M")
LATESTBENCH=$(word 1,$(shell ls -t bench_*.csv 2>/dev/null))
-ifeq ($(LATESTBENCH),)
-BASELINE=
+BASELINE?=$(LATESTBENCH)
+ifeq ($(BASELINE),)
+BASELINECMD=
else
-BASELINE=--baseline $(LATESTBENCH)
+BASELINECMD=--baseline $(BASELINE)
endif
GHCOPTS=-fdiagnostics-color=always -j4 +RTS -A256m -RTS
WEBSITE=../../web/pandoc.org
REVISION?=1
-# Note: for benchmarks we use +RTS -A256m -I0 -RTS ; otherwise the benchmarks
-# are measuring garbage collecting, and this can vary depending on which
-# other benchmarks are run.
# For gauge:
-BENCHARGS?=--small --ci=0.90 --match=pattern $(PATTERN) +RTS -T -A256m -I0 -RTS
+# BENCHARGS?=--small --ci=0.90 --match=pattern $(PATTERN)
# For tasty-bench:
-# BENCHARGS?=--csv bench_$(TIMESTAMP).csv --timeout=6 +RTS -T -A256m -I0 -RTS $(if $(PATTERN),--pattern "$(PATTERN)",)
+BENCHARGS?=--csv bench_$(TIMESTAMP).csv $(BASELINECMD) --timeout=6 +RTS -T -RTS $(if $(PATTERN),--pattern "$(PATTERN)",)
quick:
stack install --ghc-options='$(GHCOPTS)' --install-ghc --flag 'pandoc:embed_data_files' --fast --test --ghc-options='$(GHCOPTS)' --test-arguments='-j4 --hide-successes $(TESTARGS)'
@@ -58,11 +56,9 @@ ghcid-test:
bench:
stack bench \
- --ghc-options '-Rghc-timing $(GHCOPTS)' \
+ --ghc-options '$(GHCOPTS)' \
--benchmark-arguments='$(BENCHARGS)' 2>&1 | \
tee "bench_latest.txt"
- perl -ne 'if (/\r/) { s/\x1b\[[0-9;]*[mGK]//g;s/^.*\r//;print; }' \
- bench_latest.txt > "bench_$(TIMESTAMP).txt"
reformat:
for f in $(SOURCEFILES); do echo $$f; stylish-haskell -i $$f ; done