forked from timtylin/scholdoc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bump criterion to 1.0 API for benchmark
- Loading branch information
Showing
3 changed files
with
7 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{- | ||
Copyright (C) 2012-2014 John MacFarlane <[email protected]> | ||
Copyright (C) 2015 Tim T.Y. Lin <[email protected]> | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
|
@@ -17,9 +18,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
-} | ||
import Text.Pandoc | ||
import Criterion.Main | ||
import Criterion.Config | ||
import System.Environment (getArgs) | ||
import Data.Monoid | ||
import Criterion.Types | ||
import Data.Maybe (mapMaybe) | ||
import Debug.Trace (trace) | ||
|
||
|
@@ -41,9 +40,6 @@ writerBench doc (name, writer) = bench (name ++ " writer") $ nf | |
|
||
main :: IO () | ||
main = do | ||
args <- getArgs | ||
(conf,_) <- parseArgs defaultConfig{ cfgSamples = Last $ Just 20 } | ||
defaultOptions args | ||
inp <- readFile "tests/testsuite.txt" | ||
let opts = def{ readerSmart = True } | ||
let doc = readMarkdown opts inp | ||
|
@@ -53,5 +49,5 @@ main = do | |
let writers' = [(n,w) | (n, PureStringWriter w) <- writers] | ||
let writerBs = map (writerBench doc) | ||
$ writers' | ||
defaultMainWith conf (return ()) $ | ||
writerBs ++ readerBs | ||
let conf = defaultConfig { timeLimit = 2.0 } | ||
defaultMainWith conf $ writerBs ++ readerBs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters