@@ 1,4 1,4 @@
-{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE TemplateHaskell, OverloadedStrings #-}
module Main where
import Criterion.Main
import Data.Text.Glyphize
@@ 28,8 28,12 @@ main = defaultMain [
bench "Week-Head" $ whnf shapeStr dracula,
bench "Normal Form" $ nf shapeStr dracula,
bench "Paragraphs" $ nf (map shapeStr) $ Txt.lines dracula,
- bench "Parallelised" $ nf (parMap rdeepseq shapeStr) $ Txt.lines dracula
+ bench "Words" $ nf (map shapeStr) $ Txt.words dracula,
+ bench "Parallelised" $ nf (parMap rdeepseq shapeStr) $ Txt.lines dracula,
+ bench "Parallelised words" $ nf (parMap rdeepseq shapeStr) $
+ Txt.words dracula
],
+ bench "Word" $ nf shapeStr "Dracula",
bgroup "building blocks" [
bench "peekArray (NF)" $ nfIO $ Txt.useAsPtr (Txt.toStrict dracula) $
\ptr l -> peekArray (fromEnum l) ptr,