diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2013-05-09 10:38:11 -0700 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2013-06-24 20:27:37 -0700 |
commit | 5f4a32e46588b5a89cfa38d7ac51e192d62430cc (patch) | |
tree | 3850ce2847269455c5c6307bac6793e60a325aa7 /benchmark | |
parent | a578a490ee0c73360ea2b98b4d4cc39410a571e0 (diff) |
Use aeson for json.
Benchmarked: about twice as slow as json!
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/benchmark-pandoc.hs | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/benchmark/benchmark-pandoc.hs b/benchmark/benchmark-pandoc.hs index 2990bed87..482293ab0 100644 --- a/benchmark/benchmark-pandoc.hs +++ b/benchmark/benchmark-pandoc.hs @@ -1,8 +1,6 @@ import Text.Pandoc -import Text.Pandoc.Shared (normalize) import Criterion.Main import Criterion.Config -import Text.JSON.Generic import System.Environment (getArgs) import Data.Monoid @@ -26,11 +24,6 @@ writerBench :: Pandoc writerBench doc (name, writer) = bench (name ++ " writer") $ nf (writer def{ writerWrapText = True }) doc -normalizeBench :: Pandoc -> [Benchmark] -normalizeBench doc = [ bench "normalize - with" $ nf (encodeJSON . normalize) doc - , bench "normalize - without" $ nf encodeJSON doc - ] - main :: IO () main = do args <- getArgs @@ -42,5 +35,5 @@ main = do let readerBs = map (readerBench doc) readers let writers' = [(n,w) | (n, PureStringWriter w) <- writers] defaultMainWith conf (return ()) $ - map (writerBench doc) writers' ++ readerBs ++ normalizeBench doc + map (writerBench doc) writers' ++ readerBs |