@@ -8,7 +8,7 @@ import Control.Exception (evaluate)
88import Criterion.Main
99import Data.Char
1010import Data.Monoid (mappend, mempty)
11−import qualified Codec.Binary.UTF8.Generic as UTF8
11+import qualified Data.ByteString.UTF8 as UTF8
1212import qualified Data.Text as TS
1313import qualified Data.Text.IO as TS
1414import qualified Data.Text.Lazy as TL
@@ -114,6 +114,13 @@ main = do
114114 , bench "bl" $ nf (BL.drop (bla_len `div` 3)) bla
115115 , bench "l" $ nf (L.drop (la_len `div` 3)) la
116116 ],
117+ bgroup "encode" [
118+ bench "ts" $ nf TS.encodeUtf8 tsa
119+ , bench "tl" $ nf TL.encodeUtf8 tla
120+ , bench "bs" $ nf BS.pack la
121+ , bench "bl" $ nf BL.pack la
122+ , bench "l" $ nf UTF8.fromString la
123+ ],
117124 bgroup "filter" [
118125 bench "ts" $ nf (TS.filter p0) tsa
119126 , bench "tl" $ nf (TL.filter p0) tla