Commit 03160706 authored by Bodigrim's avatar Bodigrim
Browse files

Do not benchmark bytestrings, this is out of scope and takes time

parent 3f33d708
......@@ -18,26 +18,17 @@ import qualified Data.Text.Encoding as T
import qualified Data.Text.Lazy as TL
import qualified Data.Text.Lazy.Encoding as TL
type Env = (T.Text, TL.Text, B.ByteString, BL.ByteString, BL.ByteString, String)
type Env = (T.Text, TL.Text)
initEnv :: FilePath -> IO Env
initEnv fp = do
b <- B.readFile fp
bl1 <- BL.readFile fp
-- A lazy bytestring is a list of chunks. When we do not explicitly create two
-- different lazy bytestrings at a different address, the bytestring library
-- will compare the chunk addresses instead of the chunk contents. This is why
-- we read the lazy bytestring twice here.
bl2 <- BL.readFile fp
l <- readFile fp
return (T.decodeUtf8 b, TL.decodeUtf8 bl1, b, bl1, bl2, l)
return (T.decodeUtf8 b, TL.decodeUtf8 bl1)
benchmark :: Env -> Benchmark
benchmark ~(t, tl, b, bl1, bl2, l) =
benchmark ~(t, tl) =
bgroup "Equality"
[ bench "Text" $ whnf (== T.init t `T.snoc` '\xfffd') t
, bench "LazyText" $ whnf (== TL.init tl `TL.snoc` '\xfffd') tl
, bench "ByteString" $ whnf (== B.init b `B.snoc` '\xfffd') b
, bench "LazyByteString" $ whnf (== BL.init bl2 `BL.snoc` '\xfffd') bl1
, bench "String" $ whnf (== init l ++ "\xfffd") l
]
......@@ -21,10 +21,7 @@ import qualified Data.Text.Lazy.IO as LT
benchmark :: FilePath -> Benchmark
benchmark p = bgroup "FileRead"
[ bench "String" $ whnfIO $ length <$> readFile p
, bench "ByteString" $ whnfIO $ SB.length <$> SB.readFile p
, bench "LazyByteString" $ whnfIO $ LB.length <$> LB.readFile p
, bench "Text" $ whnfIO $ T.length <$> T.readFile p
[ bench "Text" $ whnfIO $ T.length <$> T.readFile p
, bench "LazyText" $ whnfIO $ LT.length <$> LT.readFile p
, bench "TextByteString" $ whnfIO $
(T.length . T.decodeUtf8) <$> SB.readFile p
......
......@@ -12,14 +12,12 @@ module Benchmarks.FoldLines
import Test.Tasty.Bench (Benchmark, bgroup, bench, whnfIO)
import System.IO
import qualified Data.ByteString as B
import qualified Data.Text as T
import qualified Data.Text.IO as T
benchmark :: FilePath -> Benchmark
benchmark fp = bgroup "ReadLines"
[ bench "Text" $ withHandle $ foldLinesT (\n _ -> n + 1) (0 :: Int)
, bench "ByteString" $ withHandle $ foldLinesB (\n _ -> n + 1) (0 :: Int)
]
where
withHandle f = whnfIO $ do
......@@ -42,17 +40,3 @@ foldLinesT f z0 h = go z0
l <- T.hGetLine h
let z' = f z l in go z'
{-# INLINE foldLinesT #-}
-- | ByteString line fold
--
foldLinesB :: (a -> B.ByteString -> a) -> a -> Handle -> IO a
foldLinesB f z0 h = go z0
where
go !z = do
eof <- hIsEOF h
if eof
then return z
else do
l <- B.hGetLine h
let z' = f z l in go z'
{-# INLINE foldLinesB #-}
......@@ -17,11 +17,9 @@ module Benchmarks.Programs.Cut
) where
import Test.Tasty.Bench (Benchmark, bgroup, bench, whnfIO)
import System.IO (Handle, hPutStr)
import System.IO (Handle)
import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as BC
import qualified Data.ByteString.Lazy as BL
import qualified Data.ByteString.Lazy.Char8 as BLC
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
import qualified Data.Text.IO as T
......@@ -31,10 +29,7 @@ import qualified Data.Text.Lazy.IO as TL
benchmark :: FilePath -> Handle -> Int -> Int -> Benchmark
benchmark p sink from to = bgroup "Cut"
[ bench' "String" string
, bench' "ByteString" byteString
, bench' "LazyByteString" lazyByteString
, bench' "Text" text
[ bench' "Text" text
, bench' "LazyText" lazyText
, bench' "TextByteString" textByteString
, bench' "LazyTextByteString" lazyTextByteString
......@@ -42,29 +37,6 @@ benchmark p sink from to = bgroup "Cut"
where
bench' n s = bench n $ whnfIO (s p sink from to)
string :: FilePath -> Handle -> Int -> Int -> IO ()
string fp sink from to = do
s <- readFile fp
hPutStr sink $ cut s
where
cut = unlines . map (take (to - from) . drop from) . lines
byteString :: FilePath -> Handle -> Int -> Int -> IO ()
byteString fp sink from to = do
bs <- B.readFile fp
B.hPutStr sink $ cut bs
where
cut = BC.unlines . map (B.take (to - from) . B.drop from) . BC.lines
lazyByteString :: FilePath -> Handle -> Int -> Int -> IO ()
lazyByteString fp sink from to = do
bs <- BL.readFile fp
BL.hPutStr sink $ cut bs
where
cut = BLC.unlines . map (BL.take (to' - from') . BL.drop from') . BLC.lines
from' = fromIntegral from
to' = fromIntegral to
text :: FilePath -> Handle -> Int -> Int -> IO ()
text fp sink from to = do
t <- T.readFile fp
......
......@@ -19,11 +19,9 @@ module Benchmarks.Programs.Sort
import Test.Tasty.Bench (Benchmark, bgroup, bench, whnfIO)
import Data.Monoid (mconcat)
import System.IO (Handle, hPutStr)
import System.IO (Handle)
import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as BC
import qualified Data.ByteString.Lazy as BL
import qualified Data.ByteString.Lazy.Char8 as BLC
import qualified Data.List as L
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
......@@ -35,11 +33,7 @@ import qualified Data.Text.Lazy.IO as TL
benchmark :: FilePath -> Handle -> Benchmark
benchmark i o = bgroup "Sort"
[ bench "String" $ whnfIO $ readFile i >>= hPutStr o . string
, bench "ByteString" $ whnfIO $ B.readFile i >>= B.hPutStr o . byteString
, bench "LazyByteString" $ whnfIO $
BL.readFile i >>= BL.hPutStr o . lazyByteString
, bench "Text" $ whnfIO $ T.readFile i >>= T.hPutStr o . text
[ bench "Text" $ whnfIO $ T.readFile i >>= T.hPutStr o . text
, bench "LazyText" $ whnfIO $ TL.readFile i >>= TL.hPutStr o . lazyText
, bench "TextByteString" $ whnfIO $ B.readFile i >>=
B.hPutStr o . T.encodeUtf8 . text . T.decodeUtf8
......@@ -49,15 +43,6 @@ benchmark i o = bgroup "Sort"
BL.hPutStr o . TL.encodeUtf8 . textBuilder . T.decodeUtf8
]
string :: String -> String
string = unlines . L.sort . lines
byteString :: B.ByteString -> B.ByteString
byteString = BC.unlines . L.sort . BC.lines
lazyByteString :: BL.ByteString -> BL.ByteString
lazyByteString = BLC.unlines . L.sort . BLC.lines
text :: T.Text -> T.Text
text = T.unlines . L.sort . T.lines
......
......@@ -16,32 +16,22 @@ module Benchmarks.Programs.StripTags
) where
import Test.Tasty.Bench (Benchmark, bgroup, bench, whnfIO)
import Data.List (mapAccumL)
import System.IO (Handle, hPutStr)
import System.IO (Handle)
import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as BC
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
import qualified Data.Text.IO as T
benchmark :: FilePath -> Handle -> Benchmark
benchmark i o = bgroup "StripTags"
[ bench "String" $ whnfIO $ readFile i >>= hPutStr o . string
, bench "ByteString" $ whnfIO $ B.readFile i >>= B.hPutStr o . byteString
, bench "Text" $ whnfIO $ T.readFile i >>= T.hPutStr o . text
[ bench "Text" $ whnfIO $ T.readFile i >>= T.hPutStr o . text
, bench "TextByteString" $ whnfIO $
B.readFile i >>= B.hPutStr o . T.encodeUtf8 . text . T.decodeUtf8
]
string :: String -> String
string = snd . mapAccumL step 0
text :: T.Text -> T.Text
text = snd . T.mapAccumL step 0
byteString :: B.ByteString -> B.ByteString
byteString = snd . BC.mapAccumL step 0
step :: Int -> Char -> (Int, Char)
step d c
| d > 0 || d' > 0 = (d', ' ')
......
......@@ -19,7 +19,7 @@ module Benchmarks.Programs.Throughput
) where
import Test.Tasty.Bench (Benchmark, bgroup, bench, whnfIO)
import System.IO (Handle, hPutStr)
import System.IO (Handle)
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL
import qualified Data.Text.Encoding as T
......@@ -29,10 +29,7 @@ import qualified Data.Text.Lazy.IO as TL
benchmark :: FilePath -> Handle -> Benchmark
benchmark fp sink = bgroup "Throughput"
[ bench "String" $ whnfIO $ readFile fp >>= hPutStr sink
, bench "ByteString" $ whnfIO $ B.readFile fp >>= B.hPutStr sink
, bench "LazyByteString" $ whnfIO $ BL.readFile fp >>= BL.hPutStr sink
, bench "Text" $ whnfIO $ T.readFile fp >>= T.hPutStr sink
[ bench "Text" $ whnfIO $ T.readFile fp >>= T.hPutStr sink
, bench "LazyText" $ whnfIO $ TL.readFile fp >>= TL.hPutStr sink
, bench "TextByteString" $ whnfIO $
B.readFile fp >>= B.hPutStr sink . T.encodeUtf8 . T.decodeUtf8
......
......@@ -15,14 +15,12 @@ module Benchmarks.Pure
import Control.DeepSeq (NFData (..))
import Control.Exception (evaluate)
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#, (+#))
import GHC.Generics (Generic)
import GHC.Int (Int64)
import qualified Data.ByteString.Char8 as BS
import qualified Data.ByteString.Lazy.Char8 as BL
import qualified Data.ByteString.UTF8 as UTF8
import qualified Data.List as L
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
......@@ -36,15 +34,11 @@ data Env = Env
, tb :: !T.Text
, tla :: !TL.Text
, tlb :: !TL.Text
, bsb :: !BS.ByteString
, bla :: !BL.ByteString
, blb :: !BL.ByteString
, bsa_len :: !Int
, ta_len :: !Int
, bla_len :: !Int64
, tla_len :: !Int64
, bsl :: [BS.ByteString]
, bll :: [BL.ByteString]
, tl :: [T.Text]
, tll :: [TL.Text]
} deriving (Generic)
......@@ -65,10 +59,7 @@ initEnv fp = do
tla <- evaluate $ TL.fromChunks (T.chunksOf 16376 ta)
tlb <- evaluate $ TL.fromChunks (T.chunksOf 16376 tb)
-- ByteString B, LazyByteString A/B
bsb <- evaluate $ T.encodeUtf8 tb
bla <- evaluate $ BL.fromChunks (chunksOf 16376 bsa)
blb <- evaluate $ BL.fromChunks (chunksOf 16376 bsb)
-- Lengths
bsa_len <- evaluate $ BS.length bsa
......@@ -77,8 +68,6 @@ initEnv fp = do
tla_len <- evaluate $ TL.length tla
-- Lines
bsl <- evaluate $ BS.lines bsa
bll <- evaluate $ BL.lines bla
tl <- evaluate $ T.lines ta
tll <- evaluate $ TL.lines tla
......@@ -90,34 +79,23 @@ benchmark kind ~Env{..} =
[ bgroup "append"
[ benchT $ nf (T.append tb) ta
, benchTL $ nf (TL.append tlb) tla
, benchBS $ nf (BS.append bsb) bsa
, benchBSL $ nf (BL.append blb) bla
]
, bgroup "concat"
[ benchT $ nf T.concat tl
, benchTL $ nf TL.concat tll
, benchBS $ nf BS.concat bsl
, benchBSL $ nf BL.concat bll
]
, bgroup "cons"
[ benchT $ nf (T.cons c) ta
, benchTL $ nf (TL.cons c) tla
, benchBS $ nf (BS.cons c) bsa
, benchBSL $ nf (BL.cons c) bla
]
-- concatMap exceeds 4G heap size on current test data
-- , bgroup "concatMap"
-- [ benchT $ nf (T.concatMap (T.replicate 3 . T.singleton)) ta
-- , benchTL $ nf (TL.concatMap (TL.replicate 3 . TL.singleton)) tla
-- , benchBS $ nf (BS.concatMap (BS.replicate 3)) bsa
-- , benchBSL $ nf (BL.concatMap (BL.replicate 3)) bla
-- ]
, bgroup "decode"
[ benchT $ nf T.decodeUtf8 bsa
, benchTL $ nf TL.decodeUtf8 bla
, benchBS $ nf BS.unpack bsa
, benchBSL $ nf BL.unpack bla
, benchS $ nf UTF8.toString bsa
]
, bgroup "decode'"
[ benchT $ nf T.decodeUtf8' bsa
......@@ -126,8 +104,6 @@ benchmark kind ~Env{..} =
, bgroup "drop"
[ benchT $ nf (T.drop (ta_len `div` 3)) ta
, benchTL $ nf (TL.drop (tla_len `div` 3)) tla
, benchBS $ nf (BS.drop (bsa_len `div` 3)) bsa
, benchBSL $ nf (BL.drop (bla_len `div` 3)) bla
]
, bgroup "encode"
[ benchT $ nf T.encodeUtf8 ta
......@@ -136,255 +112,171 @@ benchmark kind ~Env{..} =
, bgroup "filter"
[ benchT $ nf (T.filter p0) ta
, benchTL $ nf (TL.filter p0) tla
, benchBS $ nf (BS.filter p0) bsa
, benchBSL $ nf (BL.filter p0) bla
]
, bgroup "filter.filter"
[ benchT $ nf (T.filter p1 . T.filter p0) ta
, benchTL $ nf (TL.filter p1 . TL.filter p0) tla
, benchBS $ nf (BS.filter p1 . BS.filter p0) bsa
, benchBSL $ nf (BL.filter p1 . BL.filter p0) bla
]
, bgroup "foldl'"
[ benchT $ nf (T.foldl' len 0) ta
, benchTL $ nf (TL.foldl' len 0) tla
, benchBS $ nf (BS.foldl' len 0) bsa
, benchBSL $ nf (BL.foldl' len 0) bla
]
, bgroup "foldr"
[ benchT $ nf (L.length . T.foldr (:) []) ta
, benchTL $ nf (L.length . TL.foldr (:) []) tla
, benchBS $ nf (L.length . BS.foldr (:) []) bsa
, benchBSL $ nf (L.length . BL.foldr (:) []) bla
]
, bgroup "head"
[ benchT $ nf T.head ta
, benchTL $ nf TL.head tla
, benchBS $ nf BS.head bsa
, benchBSL $ nf BL.head bla
]
, bgroup "init"
[ benchT $ nf T.init ta
, benchTL $ nf TL.init tla
, benchBS $ nf BS.init bsa
, benchBSL $ nf BL.init bla
]
, bgroup "intercalate"
[ benchT $ nf (T.intercalate tsw) tl
, benchTL $ nf (TL.intercalate tlw) tll
, benchBS $ nf (BS.intercalate bsw) bsl
, benchBSL $ nf (BL.intercalate blw) bll
]
, bgroup "intersperse"
[ benchT $ nf (T.intersperse c) ta
, benchTL $ nf (TL.intersperse c) tla
, benchBS $ nf (BS.intersperse c) bsa
, benchBSL $ nf (BL.intersperse c) bla
]
, bgroup "isInfixOf"
[ benchT $ nf (T.isInfixOf tsw) ta
, benchTL $ nf (TL.isInfixOf tlw) tla
, benchBS $ nf (BS.isInfixOf bsw) bsa
-- no isInfixOf for lazy bytestrings
]
, bgroup "last"
[ benchT $ nf T.last ta
, benchTL $ nf TL.last tla
, benchBS $ nf BS.last bsa
, benchBSL $ nf BL.last bla
]
, bgroup "map"
[ benchT $ nf (T.map f) ta
, benchTL $ nf (TL.map f) tla
, benchBS $ nf (BS.map f) bsa
, benchBSL $ nf (BL.map f) bla
]
, bgroup "mapAccumL"
[ benchT $ nf (T.mapAccumL g 0) ta
, benchTL $ nf (TL.mapAccumL g 0) tla
, benchBS $ nf (BS.mapAccumL g 0) bsa
, benchBSL $ nf (BL.mapAccumL g 0) bla
]
, bgroup "mapAccumR"
[ benchT $ nf (T.mapAccumR g 0) ta
, benchTL $ nf (TL.mapAccumR g 0) tla
, benchBS $ nf (BS.mapAccumR g 0) bsa
, benchBSL $ nf (BL.mapAccumR g 0) bla
]
, bgroup "map.map"
[ benchT $ nf (T.map f . T.map f) ta
, benchTL $ nf (TL.map f . TL.map f) tla
, benchBS $ nf (BS.map f . BS.map f) bsa
, benchBSL $ nf (BL.map f . BL.map f) bla
]
, bgroup "replicate char"
[ benchT $ nf (T.replicate bsa_len) (T.singleton c)
, benchTL $ nf (TL.replicate (fromIntegral bsa_len)) (TL.singleton c)
, benchBS $ nf (BS.replicate bsa_len) c
, benchBSL $ nf (BL.replicate (fromIntegral bsa_len)) c
, benchS $ nf (L.replicate bsa_len) c
]
, bgroup "replicate string"
[ benchT $ nf (T.replicate (bsa_len `div` T.length tsw)) tsw
, benchTL $ nf (TL.replicate (fromIntegral bsa_len `div` TL.length tlw)) tlw
, benchS $ nf (replicat (bsa_len `div` T.length tsw)) lw
]
, bgroup "reverse"
[ benchT $ nf T.reverse ta
, benchTL $ nf TL.reverse tla
, benchBS $ nf BS.reverse bsa
, benchBSL $ nf BL.reverse bla
]
, bgroup "take"
[ benchT $ nf (T.take (ta_len `div` 3)) ta
, benchTL $ nf (TL.take (tla_len `div` 3)) tla
, benchBS $ nf (BS.take (bsa_len `div` 3)) bsa
, benchBSL $ nf (BL.take (bla_len `div` 3)) bla
]
, bgroup "tail"
[ benchT $ nf T.tail ta
, benchTL $ nf TL.tail tla
, benchBS $ nf BS.tail bsa
, benchBSL $ nf BL.tail bla
]
, bgroup "toLower"
[ benchT $ nf T.toLower ta
, benchTL $ nf TL.toLower tla
, benchBS $ nf (BS.map toLower) bsa
, benchBSL $ nf (BL.map toLower) bla
]
, bgroup "toUpper"
[ benchT $ nf T.toUpper ta
, benchTL $ nf TL.toUpper tla
, benchBS $ nf (BS.map toUpper) bsa
, benchBSL $ nf (BL.map toUpper) bla
]
, bgroup "uncons"
[ benchT $ nf T.uncons ta
, benchTL $ nf TL.uncons tla
, benchBS $ nf BS.uncons bsa
, benchBSL $ nf BL.uncons bla
]
, bgroup "words"
[ benchT $ nf T.words ta
, benchTL $ nf TL.words tla
, benchBS $ nf BS.words bsa
, benchBSL $ nf BL.words bla
]
, bgroup "zipWith"
[ benchT $ nf (T.zipWith min tb) ta
, benchTL $ nf (TL.zipWith min tlb) tla
, benchBS $ nf (BS.zipWith min bsb) bsa
, benchBSL $ nf (BL.zipWith min blb) bla
]
, bgroup "length"
[ bgroup "cons"
[ benchT $ nf (T.length . T.cons c) ta
, benchTL $ nf (TL.length . TL.cons c) tla
, benchBS $ nf (BS.length . BS.cons c) bsa
, benchBSL $ nf (BL.length . BL.cons c) bla
]
, bgroup "decode"
[ benchT $ nf (T.length . T.decodeUtf8) bsa
, benchTL $ nf (TL.length . TL.decodeUtf8) bla
, benchBS $ nf (L.length . BS.unpack) bsa
, benchBSL $ nf (L.length . BL.unpack) bla
, bench "StringUTF8" $ nf (L.length . UTF8.toString) bsa
]
, bgroup "drop"
[ benchT $ nf (T.length . T.drop (ta_len `div` 3)) ta
, benchTL $ nf (TL.length . TL.drop (tla_len `div` 3)) tla
, benchBS $ nf (BS.length . BS.drop (bsa_len `div` 3)) bsa
, benchBSL $ nf (BL.length . BL.drop (bla_len `div` 3)) bla
]
, bgroup "filter"
[ benchT $ nf (T.length . T.filter p0) ta
, benchTL $ nf (TL.length . TL.filter p0) tla
, benchBS $ nf (BS.length . BS.filter p0) bsa
, benchBSL $ nf (BL.length . BL.filter p0) bla
]
, bgroup "filter.filter"
[ benchT $ nf (T.length . T.filter p1 . T.filter p0) ta
, benchTL $ nf (TL.length . TL.filter p1 . TL.filter p0) tla
, benchBS $ nf (BS.length . BS.filter p1 . BS.filter p0) bsa
, benchBSL $ nf (BL.length . BL.filter p1 . BL.filter p0) bla
]
, bgroup "init"
[ benchT $ nf (T.length . T.init) ta
, benchTL $ nf (TL.length . TL.init) tla
, benchBS $ nf (BS.length . BS.init) bsa
, benchBSL $ nf (BL.length . BL.init) bla
]
, bgroup "intercalate"
[ benchT $ nf (T.length . T.intercalate tsw) tl
, benchTL $ nf (TL.length . TL.intercalate tlw) tll
, benchBS $ nf (BS.length . BS.intercalate bsw) bsl
, benchBSL $ nf (BL.length . BL.intercalate blw) bll
]
, bgroup "intersperse"
[ benchT $ nf (T.length . T.intersperse c) ta
, benchTL $ nf (TL.length . TL.intersperse c) tla
, benchBS $ nf (BS.length . BS.intersperse c) bsa
, benchBSL $ nf (BL.length . BL.intersperse c) bla
]
, bgroup "map"
[ benchT $ nf (T.length . T.map f) ta
, benchTL $ nf (TL.length . TL.map f) tla
, benchBS $ nf (BS.length . BS.map f) bsa
, benchBSL $ nf (BL.length . BL.map f) bla
]
, bgroup "map.map"
[ benchT $ nf (T.length . T.map f . T.map f) ta
, benchTL $ nf (TL.length . TL.map f . TL.map f) tla
, benchBS $ nf (BS.length . BS.map f . BS.map f) bsa
]
, bgroup "replicate char"
[ benchT $ nf (T.length . T.replicate bsa_len) (T.singleton c)
, benchTL $ nf (TL.length . TL.replicate (fromIntegral bsa_len)) (TL.singleton c)
, benchBS $ nf (BS.length . BS.replicate bsa_len) c
, benchBSL $ nf (BL.length . BL.replicate (fromIntegral bsa_len)) c
, benchS $ nf (L.length . L.replicate bsa_len) c
]
, bgroup "replicate string"
[ benchT $ nf (T.length . T.replicate (bsa_len `div` T.length tsw)) tsw
, benchTL $ nf (TL.length . TL.replicate (fromIntegral bsa_len `div` TL.length tlw)) tlw
, benchS $ nf (L.length . replicat (bsa_len `div` T.length tsw)) lw
]
, bgroup "take"
[ benchT $ nf (T.length . T.take (ta_len `div` 3)) ta
, benchTL $ nf (TL.length . TL.take (tla_len `div` 3)) tla
, benchBS $ nf (BS.length . BS.take (bsa_len `div` 3)) bsa
, benchBSL $ nf (BL.length . BL.take (bla_len `div` 3)) bla
]
, bgroup "tail"
[ benchT $ nf (T.length . T.tail) ta
, benchTL $ nf (TL.length . TL.tail) tla
, benchBS $ nf (BS.length . BS.tail) bsa
, benchBSL $ nf (BL.length . BL.tail) bla
]
, bgroup "toLower"
[ benchT $ nf (T.length . T.toLower) ta
, benchTL $ nf (TL.length . TL.toLower) tla
, benchBS $ nf (BS.length . BS.map toLower) bsa
, benchBSL $ nf (BL.length . BL.map toLower) bla
]
, bgroup "toUpper"
[ benchT $ nf (T.length . T.toUpper) ta
, benchTL $ nf (TL.length . TL.toUpper) tla
, benchBS $ nf (BS.length . BS.map toUpper) bsa
, benchBSL $ nf (BL.length . BL.map toUpper) bla
]
, bgroup "words"
[ benchT $ nf (L.length . T.words) ta
, benchTL $ nf (L.length . TL.words) tla
, benchBS $ nf (L.length . BS.words) bsa
, benchBSL $ nf (L.length . BL.words) bla
]
, bgroup "zipWith"
[ benchT $ nf (T.length . T.zipWith min tb) ta
, benchTL $ nf (TL.length . TL.zipWith min tlb) tla
, benchBS $ nf (L.length . BS.zipWith min bsb) bsa
, benchBSL $ nf (L.length . BL.zipWith min blb) bla
]
]