~alcinnz/harfbuzz-pure

ref: 56daf16fae31dff25975488dd68623608a6ca7f9 harfbuzz-pure/bench/Main.hs -rw-r--r-- 631 bytes
56daf16f — Adrian Cochrane Add benchmark, against Dracula by Bram Stoker. 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{-# LANGUAGE TemplateHaskell #-}
module Main where
import Criterion.Main
import Data.Text.Glyphize
import FileEmbedLzma (embedLazyText, embedByteString)
import Data.FileEmbed (makeRelativeToProject)
import System.FilePath ((</>))

shapeStr txt = shape font defaultBuffer { text = txt } []
  where font = createFont $ createFace $(
                    makeRelativeToProject ("assets" </> "Lora-Regular.ttf") >>=
                    embedByteString) 0

main = defaultMain [
    bgroup "literature" [
        bench "Dracula" $ whnf shapeStr
            $(makeRelativeToProject ("bench" </> "dracula.txt") >>= embedLazyText)
    ]
  ]