3-- Copyright : (c) 2018 Harendra Kumar
6-- Maintainer : streamly@composewell.com
8import Control.DeepSeq (NFData)
9import Data.Functor.Identity (Identity, runIdentity)
10import System.Random (randomRIO)
11import qualified NestedOps as Ops
14import System.Environment (getArgs)
15import Text.Read (readMaybe)
17benchIO :: (NFData b) => String -> (Int -> IO b) -> Benchmark
18benchIO name f = bench name $ nfIO $ randomRIO (1,1) >>= f
20_benchId :: (NFData b) => String -> (Int -> Identity b) -> Benchmark
21_benchId name f = bench name $ nf (\g -> runIdentity (g 1)) f
25 -- TBD Study scaling with 10, 100, 1000 loop iterations
26 -- Basement.Terminal.initialize required?
28 let (linearCount, args') = parseValue args
29 (cfg, extra) = parseWith defaultConfig args'
30 runMode (mode cfg) cfg extra
33 [ benchIO "toNullAp" $ Ops.toNullAp linearCount aheadly
34 , benchIO "toNull" $ Ops.toNull linearCount aheadly
35 , benchIO "toNull3" $ Ops.toNull3 linearCount aheadly
36 , benchIO "toList" $ Ops.toList linearCount aheadly
37 -- , benchIO "toListSome" $ Ops.toListSome aheadly
38 , benchIO "filterAllOut" $ Ops.filterAllOut linearCount aheadly
39 , benchIO "filterAllIn" $ Ops.filterAllIn linearCount aheadly
40 , benchIO "filterSome" $ Ops.filterSome linearCount aheadly
41 , benchIO "breakAfterSome" $ Ops.breakAfterSome linearCount aheadly
45 [ benchIO "toNullAp" $ Ops.toNullAp linearCount asyncly
46 , benchIO "toNull" $ Ops.toNull linearCount asyncly
47 , benchIO "toNull3" $ Ops.toNull3 linearCount asyncly
48 , benchIO "toList" $ Ops.toList linearCount asyncly
49 -- , benchIO "toListSome" $ Ops.toListSome asyncly
50 , benchIO "filterAllOut" $ Ops.filterAllOut linearCount asyncly
51 , benchIO "filterAllIn" $ Ops.filterAllIn linearCount asyncly
52 , benchIO "filterSome" $ Ops.filterSome linearCount asyncly
53 , benchIO "breakAfterSome" $ Ops.breakAfterSome linearCount asyncly
57 [ benchIO "toNullAp" $ Ops.toNullAp linearCount wAsyncly
58 , benchIO "toNull" $ Ops.toNull linearCount wAsyncly
59 , benchIO "toNull3" $ Ops.toNull3 linearCount wAsyncly
60 , benchIO "toList" $ Ops.toList linearCount wAsyncly
61 -- , benchIO "toListSome" $ Ops.toListSome wAsyncly
62 , benchIO "filterAllOut" $ Ops.filterAllOut linearCount wAsyncly
63 , benchIO "filterAllIn" $ Ops.filterAllIn linearCount wAsyncly
64 , benchIO "filterSome" $ Ops.filterSome linearCount wAsyncly
65 , benchIO "breakAfterSome" $ Ops.breakAfterSome linearCount wAsyncly
69 [ benchIO "toNullAp" $ Ops.toNullAp linearCount parallely
70 , benchIO "toNull" $ Ops.toNull linearCount parallely
71 , benchIO "toNull3" $ Ops.toNull3 linearCount parallely
72 , benchIO "toList" $ Ops.toList linearCount parallely
73 --, benchIO "toListSome" $ Ops.toListSome parallely
74 , benchIO "filterAllOut" $ Ops.filterAllOut linearCount parallely
75 , benchIO "filterAllIn" $ Ops.filterAllIn linearCount parallely
76 , benchIO "filterSome" $ Ops.filterSome linearCount parallely
77 , benchIO "breakAfterSome" $ Ops.breakAfterSome linearCount parallely
81 [ benchIO "toNullAp" $ Ops.toNullAp linearCount zipAsyncly
86 parseValue [] = (defaultValue, [])
88 case (readMaybe x :: Maybe Int) of
89 Just value -> (value, xs)
90 Nothing -> (defaultValue, a)
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