Commit b62314eb authored by Bodigrim's avatar Bodigrim
Browse files

Switch from criterion to tasty-bench to avoid transitive dependencies on text

parent fa149f7b
......@@ -5,7 +5,7 @@ module Main
( main
) where
import Criterion.Main (defaultMain, bgroup, env)
import Test.Tasty.Bench (defaultMain, bgroup, env)
import System.FilePath ((</>))
import System.IO (IOMode (WriteMode), openFile, hSetEncoding, utf8)
......
......@@ -9,7 +9,7 @@ module Benchmarks.Builder
( benchmark
) where
import Criterion (Benchmark, bgroup, bench, nf)
import Test.Tasty.Bench (Benchmark, bgroup, bench, nf)
import Data.Binary.Builder as B
import Data.ByteString.Char8 ()
import Data.Monoid (mconcat, mempty)
......
......@@ -3,7 +3,7 @@
module Benchmarks.Concat (benchmark) where
import Control.Monad.Trans.Writer
import Criterion (Benchmark, bgroup, bench, whnf)
import Test.Tasty.Bench (Benchmark, bgroup, bench, whnf)
import Data.Text as T
benchmark :: Benchmark
......
......@@ -25,8 +25,8 @@ import Data.ByteString.Lazy.Internal (ByteString(..))
import Foreign.Ptr (Ptr, plusPtr)
import Foreign.ForeignPtr (withForeignPtr)
import Data.Word (Word8)
import qualified Criterion as C
import Criterion (Benchmark, bgroup, nf, whnfIO)
import qualified Test.Tasty.Bench as C
import Test.Tasty.Bench (Benchmark, bgroup, nf, whnfIO)
import qualified Codec.Binary.UTF8.Generic as U8
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL
......
......@@ -10,7 +10,7 @@ module Benchmarks.EncodeUtf8
( benchmark
) where
import Criterion (Benchmark, bgroup, bench, whnf)
import Test.Tasty.Bench (Benchmark, bgroup, bench, whnf)
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL
import qualified Data.Text as T
......
......@@ -10,7 +10,7 @@ module Benchmarks.Equality
, benchmark
) where
import Criterion (Benchmark, bgroup, bench, whnf)
import Test.Tasty.Bench (Benchmark, bgroup, bench, whnf)
import qualified Data.ByteString.Char8 as B
import qualified Data.ByteString.Lazy.Char8 as BL
import qualified Data.Text as T
......
......@@ -9,7 +9,7 @@ module Benchmarks.FileRead
) where
import Control.Applicative ((<$>))
import Criterion (Benchmark, bgroup, bench, whnfIO)
import Test.Tasty.Bench (Benchmark, bgroup, bench, whnfIO)
import qualified Data.ByteString as SB
import qualified Data.ByteString.Lazy as LB
import qualified Data.Text as T
......
......@@ -10,7 +10,7 @@ module Benchmarks.FoldLines
( benchmark
) where
import Criterion (Benchmark, bgroup, bench, whnfIO)
import Test.Tasty.Bench (Benchmark, bgroup, bench, whnfIO)
import System.IO
import qualified Data.ByteString as B
import qualified Data.Text as T
......
......@@ -4,7 +4,7 @@ module Benchmarks.Mul
) where
import Control.Exception (evaluate)
import Criterion.Main
import Test.Tasty.Bench
import Data.Int (Int32, Int64)
import Data.Text.Internal (mul32, mul64)
import qualified Data.Vector.Unboxed as U
......
......@@ -11,7 +11,7 @@ module Benchmarks.Programs.BigTable
( benchmark
) where
import Criterion (Benchmark, bench, whnfIO)
import Test.Tasty.Bench (Benchmark, bench, whnfIO)
import Data.Monoid (mappend, mconcat)
import Data.Text.Lazy.Builder (Builder, fromText, toLazyText)
import Data.Text.Lazy.IO (hPutStr)
......
......@@ -16,7 +16,7 @@ module Benchmarks.Programs.Cut
( benchmark
) where
import Criterion (Benchmark, bgroup, bench, whnfIO)
import Test.Tasty.Bench (Benchmark, bgroup, bench, whnfIO)
import System.IO (Handle, hPutStr)
import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as BC
......
......@@ -21,7 +21,7 @@ import Data.List (foldl')
import Data.List (intersperse)
import Data.Monoid (mempty, mappend, mconcat)
import System.IO (Handle)
import Criterion (Benchmark, bench, whnfIO)
import Test.Tasty.Bench (Benchmark, bench, whnfIO)
import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Lazy.Builder as TLB
......
......@@ -17,7 +17,7 @@ module Benchmarks.Programs.Sort
( benchmark
) where
import Criterion (Benchmark, bgroup, bench, whnfIO)
import Test.Tasty.Bench (Benchmark, bgroup, bench, whnfIO)
import Data.Monoid (mconcat)
import System.IO (Handle, hPutStr)
import qualified Data.ByteString as B
......
......@@ -15,7 +15,7 @@ module Benchmarks.Programs.StripTags
( benchmark
) where
import Criterion (Benchmark, bgroup, bench, whnfIO)
import Test.Tasty.Bench (Benchmark, bgroup, bench, whnfIO)
import Data.List (mapAccumL)
import System.IO (Handle, hPutStr)
import qualified Data.ByteString as B
......
......@@ -18,7 +18,7 @@ module Benchmarks.Programs.Throughput
( benchmark
) where
import Criterion (Benchmark, bgroup, bench, whnfIO)
import Test.Tasty.Bench (Benchmark, bgroup, bench, whnfIO)
import System.IO (Handle, hPutStr)
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL
......
......@@ -14,7 +14,7 @@ module Benchmarks.Pure
import Control.DeepSeq (NFData (..))
import Control.Exception (evaluate)
import Criterion (Benchmark, bgroup, bench, nf)
import Test.Tasty.Bench (Benchmark, bgroup, bench, nf)
import Data.Char (toLower, toUpper)
import Data.Monoid (mappend, mempty)
import GHC.Base (Char (..), Int (..), chr#, ord#, (+#))
......
......@@ -21,7 +21,7 @@ module Benchmarks.ReadNumbers
, benchmark
) where
import Criterion (Benchmark, bgroup, bench, whnf)
import Test.Tasty.Bench (Benchmark, bgroup, bench, whnf)
import Data.List (foldl')
import Numeric (readDec, readFloat, readHex)
import qualified Data.ByteString.Char8 as B
......
......@@ -10,7 +10,7 @@ module Benchmarks.Replace
, initEnv
) where
import Criterion (Benchmark, bgroup, bench, nf)
import Test.Tasty.Bench (Benchmark, bgroup, bench, nf)
import qualified Data.ByteString.Char8 as B
import qualified Data.ByteString.Lazy as BL
import qualified Data.ByteString.Lazy.Search as BL
......
......@@ -9,7 +9,7 @@ module Benchmarks.Search
, benchmark
) where
import Criterion (Benchmark, bench, bgroup, whnf)
import Test.Tasty.Bench (Benchmark, bench, bgroup, whnf)
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL
import qualified Data.ByteString.Lazy.Search as BL
......
......@@ -14,7 +14,7 @@ module Benchmarks.Stream
) where
import Control.DeepSeq (NFData (..))
import Criterion (Benchmark, bgroup, bench, nf)
import Test.Tasty.Bench (Benchmark, bgroup, bench, nf)
import qualified Data.Text as T
import qualified Data.ByteString as B
import qualified Data.Text.Lazy as TL
......@@ -58,7 +58,7 @@ data Env = Env
} deriving (Generic, NFData)
initEnv :: FilePath -> IO Env
initEnv fp = do
initEnv fp = do
-- Different formats
t <- T.readFile fp
let !utf8 = T.encodeUtf8 t
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment