git.iko.soy/typeable/pandoc
on master help sign in
Integrated benchmark into cabal.

Can now do: cabal configure --enable-benchmarks && cabal build cabal bench --benchmark-option='markdown' --benchmark-option='-s 20'

commitc414a08bcf4a4ae6c9c8007e27b87122217cdcee authorJohn MacFarlane <jgm@berkeley.edu> dateThu 26 Jul 2012, 09:18 (14 years ago) parent45e4c12
2 files changed+21−4
Benchmark.hs → benchmark/benchmark-pandoc.hs+2−2 pandoc.cabal+19−2
Benchmark.hs → benchmark/benchmark-pandoc.hsrenamed+2−2
@@ -3,7 +3,6 @@ import Text.Pandoc.Shared (readDataFile, normalize)
33import Criterion.Main
44import Data.List (isSuffixOf)
55import Text.JSON.Generic
6−import Data.Default
76
87readerBench :: Pandoc
98 -> (String, ReaderOptions -> String -> Pandoc)
@@ -42,5 +41,6 @@ main = do
4241 let doc = readMarkdown opts inp
4342 let readerBs = map (readerBench doc) readers
4443 let writers' = [(n,w) | (n, PureStringWriter w) <- writers]
45− defaultMain $ map (writerBench doc) writers' ++ readerBs ++ normalizeBench doc
44+ defaultMain $
45+ map (writerBench doc) writers' ++ readerBs ++ normalizeBench doc
4646
pandoc.cabal+19−2
@@ -96,8 +96,6 @@ Extra-Source-Files:
9696 -- generated man pages (produced post-build)
9797 man/man1/pandoc.1,
9898 man/man5/pandoc_markdown.5,
99− -- benchmarks
100− Benchmark.hs,
10199 -- tests
102100 tests/bodybg.gif,
103101 tests/docbook-reader.docbook
@@ -427,3 +425,22 @@ Executable test-pandoc
427425 Default-Language: Haskell98
428426 Default-Extensions: CPP, TemplateHaskell, QuasiQuotes
429427
428+benchmark benchmark-pandoc
429+ Type: exitcode-stdio-1.0
430+ Main-Is: benchmark-pandoc.hs
431+ Hs-Source-Dirs: benchmark
432+ if impl(ghc >= 6.10)
433+ Build-depends: base >= 4 && < 5, syb >= 0.1 && < 0.4
434+ else
435+ Build-depends: base >= 3 && < 4
436+ Build-Depends: pandoc,
437+ criterion >= 0.5 && < 0.7,
438+ json >= 0.4 && < 0.6
439+ if impl(ghc >= 7.0.1)
440+ Ghc-Options: -O2 -rtsopts -Wall -fno-warn-unused-do-bind -dno-debug-output
441+ else
442+ if impl(ghc >= 6.12)
443+ Ghc-Options: -O2 -Wall -fno-warn-unused-do-bind -dno-debug-output
444+ else
445+ Ghc-Options: -O2 -Wall
446+ Default-Language: Haskell98