aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2010-12-25 14:07:26 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2010-12-25 14:07:26 -0800
commit87429ef2f2cc42730ee0f108f49f003776b020f4 (patch)
tree3d62112a093b8984d294630a21503cba2eb0e57a
parent82903cfaf367a68d53f6a6ab2dfad71c5f8a2502 (diff)
downloadpandoc-87429ef2f2cc42730ee0f108f49f003776b020f4.tar.gz
Added normalize benchmark to Benchmark.hs.
-rw-r--r--Benchmark.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/Benchmark.hs b/Benchmark.hs
index 9360b3436..67c790526 100644
--- a/Benchmark.hs
+++ b/Benchmark.hs
@@ -1,5 +1,5 @@
import Text.Pandoc
-import Text.Pandoc.Shared (readDataFile)
+import Text.Pandoc.Shared (readDataFile, normalize)
import Criterion.Main
import Data.List (isSuffixOf)
@@ -27,10 +27,13 @@ writerBench doc (name, writer) = bench (name ++ " writer") $ nf
writerWrapText = True
, writerLiterateHaskell = "+lhs" `isSuffixOf` name }) doc
+normalizeBench :: Pandoc -> Benchmark
+normalizeBench doc = bench "normalize" $ whnf normalize doc
+
main = do
inp <- readDataFile (Just ".") "README"
let ps = defaultParserState{ stateSmart = True }
let doc = readMarkdown ps inp
let readerBs = map (readerBench doc) readers
- defaultMain $ map (writerBench doc) writers ++ readerBs
+ defaultMain $ map (writerBench doc) writers ++ readerBs ++ [normalizeBench doc]