1-- benchmarks composing images using the renderChar operation. This is
2-- what Yi uses in Yi.UI.Vty.drawText. Ideally a sequence of renderChar
3-- images horizontally composed should provide no worse performance than
5module BenchRenderChar where
10import Control.Monad ( forM_ )
13 vty <- mkVty defaultConfig
14 (w,h) <- displayBounds $ outputIface vty
15 let testChars = return $ take 500 $ cycle $ [ c | c <- ['a'..'z']]
17 forM_ d $ \testChar -> do
18 let testImage = testImageUsingChar testChar w h
19 outPic = picForImage testImage
22 return $ Bench testChars bench
24testImageUsingChar c w h
25 = vertCat $ replicate (fromIntegral h)
26 $ horizCat $ map (char defAttr) (replicate (fromIntegral w) c)
29 vty <- mkVty defaultConfig
30 (w,h) <- displayBounds $ outputIface vty
31 let testChars = return $ take 500 $ cycle $ [ c | c <- ['a'..'z']]
33 forM_ d $ \testChar -> do
34 let testImage = charFill defAttr testChar w h
35 outPic = picForImage testImage
38 return $ Bench testChars bench
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list