git.iko.soy/typeable/pandoc
on master help sign in
Remove weigh-pandoc.

It's not really useful any more, now that our regular benchmarks include data on allocation.

commitd7cfa0ef4c926d6bb91d0a870edeea8911d81c3a authorJohn MacFarlane <jgm@berkeley.edu> dateMon 22 Feb 2021, 22:10 (6 years ago) parent21d0b47
2 files changed−56
benchmark/weigh-pandoc.hs−48 pandoc.cabal−8
benchmark/weigh-pandoc.hsdeleted−48
@@ -1,48 +0,0 @@
1−{-# LANGUAGE OverloadedStrings #-}
2−{- |
3− Module : Main
4− Copyright : © 2016-2021 John MacFarlane <jgm@berkeley.edu>
5− License : GNU GPL, version 2 or above
6−
7− Maintainer : John MacFarlane <jgm@berkeley.edu>
8− Stability : alpha
9− Portability : portable
10−
11−Benchmarks to determine resource use of readers and writers.
12−-}
13−import Weigh
14−import Text.Pandoc
15−import Data.Text (Text, unpack)
16−
17−main :: IO ()
18−main = do
19− doc <- read <$> readFile "test/testsuite.native"
20− mainWith $ do
21− func "Pandoc document" id doc
22− mapM_
23− (\(n,r) -> weighReader doc n (either (error . show) id . runPure . r def{readerExtensions = pandocExtensions}))
24− [("markdown", readMarkdown)
25− ,("html", readHtml)
26− ,("docbook", readDocBook)
27− ,("latex", readLaTeX)
28− ,("commonmark", readCommonMark)
29− ]
30− mapM_
31− (\(n,w) -> weighWriter doc n (either (error . show) id . runPure . w def))
32− [("markdown", writeMarkdown)
33− ,("html", writeHtml5String)
34− ,("docbook", writeDocbook5)
35− ,("latex", writeLaTeX)
36− ,("commonmark", writeCommonMark)
37− ]
38−
39−weighWriter :: Pandoc -> String -> (Pandoc -> Text) -> Weigh ()
40−weighWriter doc name writer = func (name ++ " writer") writer doc
41−
42−weighReader :: Pandoc -> Text -> (Text -> Pandoc) -> Weigh ()
43−weighReader doc name reader =
44− case lookup name writers of
45− Just (TextWriter writer) ->
46− let inp = either (error . show) id $ runPure $ writer def{ writerWrapText = WrapAuto} doc
47− in func (unpack $ name <> " reader") reader inp
48− _ -> return () -- no writer for reader
pandoc.cabal−8
@@ -725,14 +725,6 @@ executable trypandoc
725725 else
726726 buildable: False
727727
728−benchmark weigh-pandoc
729− import: common-executable
730− type: exitcode-stdio-1.0
731− main-is: weigh-pandoc.hs
732− hs-source-dirs: benchmark
733− build-depends: mtl >= 2.2 && < 2.3,
734− weigh >= 0.0 && < 0.1,
735−
736728test-suite test-pandoc
737729 import: common-executable
738730 type: exitcode-stdio-1.0