~alcinnz/harfbuzz-pure

be56626575991e73ed774aabf53df32d1418f895 — Adrian Cochrane 1 year, 2 months ago 0ab0042
Benchmark performance of shaping individual words.
1 files changed, 6 insertions(+), 2 deletions(-)

M bench/Main.hs
M bench/Main.hs => bench/Main.hs +6 -2
@@ 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,