Browse files

Added Benchmark.hs.

  • Loading branch information...
1 parent 6563d9d commit 96d2e01c67365cbca59f7c73a9327bb00c8f2e2d John MacFarlane committed Oct 1, 2011
Showing with 14 additions and 0 deletions.
  1. +14 −0 Benchmark.hs
View
14 Benchmark.hs
@@ -0,0 +1,14 @@
+import Text.Pandoc2
+import Criterion.Main
+import Data.List (isSuffixOf)
+import Text.JSON.Generic
+import Data.Text.Encoding (decodeUtf8)
+import Data.ByteString as B
+
+main = do
+ inp <- B.readFile "README.markdown"
+ let poptions' = poptions
+ let convert :: B.ByteString -> Maybe Blocks
+ convert = markdownDoc poptions' . decodeUtf8
+ defaultMain [ bench ("markdown reader") $ whnf convert inp ]
+

0 comments on commit 96d2e01

Please sign in to comment.