mirror of
https://github.com/jtdaugherty/brick.git
synced 2024-11-29 21:46:11 +03:00
Remove benchmark suite and dependencies
This commit is contained in:
parent
d2f9a8cc25
commit
f79da4ea2b
27
brick.cabal
27
brick.cabal
@ -75,33 +75,6 @@ executable brick
|
||||
lens,
|
||||
text
|
||||
|
||||
Flag bench
|
||||
Description: whether to build benchmarks
|
||||
Default: False
|
||||
|
||||
executable brick-bench
|
||||
hs-source-dirs: programs,src
|
||||
|
||||
if !flag(bench)
|
||||
buildable: False
|
||||
|
||||
ghc-options: -threaded -Wall -fno-warn-unused-do-bind -O3
|
||||
default-language: Haskell2010
|
||||
main-is: Bench.hs
|
||||
CPP-Options: -DBENCH
|
||||
build-depends: base <= 5,
|
||||
transformers,
|
||||
vty >= 5.2.9,
|
||||
data-default,
|
||||
lens,
|
||||
text,
|
||||
criterion,
|
||||
deepseq,
|
||||
contravariant,
|
||||
template-haskell,
|
||||
containers,
|
||||
vector
|
||||
|
||||
executable brick-viewport-scroll-demo
|
||||
hs-source-dirs: programs
|
||||
ghc-options: -threaded -Wall -fno-warn-unused-do-bind -O3
|
||||
|
@ -1,72 +0,0 @@
|
||||
{-# OPTIONS_GHC -fno-warn-orphans #-}
|
||||
module Main where
|
||||
|
||||
import Criterion.Main
|
||||
import Control.DeepSeq (NFData(..))
|
||||
import Data.Monoid
|
||||
import Data.Default
|
||||
import Graphics.Vty
|
||||
import qualified Data.Text as T
|
||||
|
||||
import Brick.AttrMap
|
||||
import Brick.Widgets.Core
|
||||
import Brick.Widgets.Border
|
||||
import Brick.Widgets.Center
|
||||
|
||||
instance NFData Widget where
|
||||
rnf w = (hSize w) `seq` (vSize w) `seq` (render w) `seq` ()
|
||||
|
||||
aMap :: AttrMap
|
||||
aMap = attrMap def []
|
||||
|
||||
sz :: DisplayRegion
|
||||
sz = (100, 100)
|
||||
|
||||
renderBench :: Widget -> Picture
|
||||
renderBench w = pic
|
||||
where
|
||||
(_, pic, _) = renderFinal aMap [w] sz (const Nothing) (RS mempty mempty)
|
||||
|
||||
mkBench :: String -> Widget -> Benchmark
|
||||
mkBench s w = bench s (nf renderBench w)
|
||||
|
||||
allGroups :: [Benchmark]
|
||||
allGroups =
|
||||
[ bgroup "widgets"
|
||||
[ mkBench "str" (str "testing")
|
||||
, mkBench "txt" (txt $ T.pack "testing")
|
||||
, mkBench "hBorder" hBorder
|
||||
, mkBench "hBorderWithLabel" (hBorderWithLabel (str "label"))
|
||||
, mkBench "vBorder" vBorder
|
||||
, mkBench "border" (border $ str "testing")
|
||||
, mkBench "fill" (fill ' ')
|
||||
, mkBench "hBoxFixed" (hBox [str "testing", str "testing"])
|
||||
, mkBench "vBoxFixed" (vBox [str "testing", str "testing"])
|
||||
, mkBench "hBoxUnlimited" (hBox [fill ' ', str "testing"])
|
||||
, mkBench "vBoxUnlimited" (vBox [fill ' ', str "testing"])
|
||||
, mkBench "empty" emptyWidget
|
||||
, mkBench "hLimit" (hLimit 1 $ str "t")
|
||||
, mkBench "vLimit" (vLimit 1 $ str "testing")
|
||||
, mkBench "hCenter" (vBox $ take 1000 $ repeat $ hCenter $ str "testing")
|
||||
|
||||
-- withDefaultAttr
|
||||
-- withDefaultAttrName
|
||||
-- withAttrName
|
||||
-- withAttrMappings
|
||||
-- forceAttr
|
||||
-- raw
|
||||
-- withBorderStyle
|
||||
-- translateBy
|
||||
-- cropLeftBy
|
||||
-- cropRightBy
|
||||
-- cropTopBy
|
||||
-- cropBottomBy
|
||||
-- showCursor
|
||||
-- viewport
|
||||
-- visible
|
||||
-- visibleRegion
|
||||
]
|
||||
]
|
||||
|
||||
main :: IO ()
|
||||
main = defaultMain allGroups
|
@ -1,4 +1,3 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
-- | This module provides the core widget combinators and rendering
|
||||
-- routines. Everything this library does is in terms of these basic
|
||||
-- primitives.
|
||||
@ -83,11 +82,6 @@ module Brick.Widgets.Core
|
||||
|
||||
-- * Misc
|
||||
, Direction(..)
|
||||
|
||||
#ifdef BENCH
|
||||
, renderFinal
|
||||
, RenderState(..)
|
||||
#endif
|
||||
)
|
||||
where
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user