git.iko.soy/typeable/pandoc
on master help sign in
Increase heap space in runtime for benchmarks.

Otherwise we're essentially benchmarking garbage collecting, which can give very inconsistent results.

commit1ef35343288ae7cb1d074c6a25aa5e47fdc55da9 authorJohn MacFarlane <jgm@berkeley.edu> dateTue 16 Mar 2021, 15:59 (6 years ago) parent94c917c
4 files changed+8−4
Makefile+5−4 benchmark/benchmark-pandoc.hs+1 pandoc.cabal+1 stack.yaml+1
Makefile+5−4
@@ -15,9 +15,10 @@ endif
1515GHCOPTS=-fdiagnostics-color=always -j4 +RTS -A256m -RTS
1616WEBSITE=../../web/pandoc.org
1717REVISION?=1
18−BENCHARGS?=--small --time-limit=2 --match=pattern $(PATTERN)
18+# For gauge:
19+BENCHARGS?=--small --ci=0.90 --match=pattern $(PATTERN) +RTS -T -A256m -I0 -RTS
1920# For tasty-bench:
20−# BENCHARGS?=--csv bench_$(TIMESTAMP).csv --timeout=6 +RTS -T -RTS $(if $(PATTERN),--pattern "$(PATTERN)",)
21+# BENCHARGS?=--csv bench_$(TIMESTAMP).csv --timeout=6 +RTS -T -A256m -I0 -RTS $(if $(PATTERN),--pattern "$(PATTERN)",)
2122
2223quick:
2324 stack install --ghc-options='$(GHCOPTS)' --install-ghc --flag 'pandoc:embed_data_files' --fast --test --ghc-options='$(GHCOPTS)' --test-arguments='-j4 --hide-successes $(TESTARGS)'
@@ -57,8 +58,8 @@ bench:
5758 --ghc-options '-Rghc-timing $(GHCOPTS)' \
5859 --benchmark-arguments='$(BENCHARGS)' 2>&1 | \
5960 tee "bench_latest.txt"
60− perl -pe 's/\x1b\[[0-9;]*[mGK]//g;s/\r//;' bench_latest.txt > \
61− "bench_$(TIMESTAMP).txt"
61+ perl -ne 'if (/\r/) { s/\x1b\[[0-9;]*[mGK]//g;s/^.*\r//;print; }' \
62+ bench_latest.txt > "bench_$(TIMESTAMP).txt"
6263
6364reformat:
6465 for f in $(SOURCEFILES); do echo $$f; stylish-haskell -i $$f ; done
benchmark/benchmark-pandoc.hs+1
@@ -23,6 +23,7 @@ import Control.Monad.Except (throwError)
2323import qualified Text.Pandoc.UTF8 as UTF8
2424import qualified Data.ByteString as B
2525import qualified Data.Text as T
26+-- import Test.Tasty.Bench
2627import Gauge
2728import qualified Data.ByteString.Lazy as BL
2829import Data.Maybe (mapMaybe)
pandoc.cabal+1
@@ -827,6 +827,7 @@ benchmark benchmark-pandoc
827827 build-depends: bytestring,
828828 containers,
829829 gauge >= 0.2 && < 0.3,
830+ -- tasty-bench >= 0.2 && <= 0.3,
830831 mtl >= 2.2 && < 2.3,
831832 text >= 1.1.1.0 && < 1.3,
832833 time,
stack.yaml+1
@@ -13,6 +13,7 @@ extra-deps:
1313- doclayout-0.3.0.2
1414- citeproc-0.3.0.9
1515- texmath-0.12.2
16+- tasty-bench-0.2.2
1617ghc-options:
1718 "$locals": -fhide-source-paths -Wno-missing-home-modules
1819resolver: lts-17.5