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)
12import Common (parseCLIOpts)
17import qualified NestedOps as Ops
19benchIO :: (NFData b) => String -> (Int -> IO b) -> Benchmark
20benchIO name f = bench name $ nfIO $ randomRIO (1,1) >>= f
22_benchId :: (NFData b) => String -> (Int -> Identity b) -> Benchmark
23_benchId name f = bench name $ nf (\g -> runIdentity (g 1)) f
25defaultStreamSize :: Int
26defaultStreamSize = 100000
30 -- XXX Fix indentation
31 (linearCount, cfg, benches) <- parseCLIOpts defaultStreamSize
32 linearCount `seq` runMode (mode cfg) cfg benches
35 [ benchIO "toNullAp" $ Ops.toNullAp linearCount aheadly
36 , benchIO "toNull" $ Ops.toNull linearCount aheadly
37 , benchIO "toNull3" $ Ops.toNull3 linearCount aheadly
38 -- , benchIO "toList" $ Ops.toList linearCount aheadly
39 , benchIO "toListSome" $ Ops.toListSome linearCount aheadly
40 , benchIO "filterAllOut" $ Ops.filterAllOut linearCount aheadly
41 , benchIO "filterAllIn" $ Ops.filterAllIn linearCount aheadly
42 , benchIO "filterSome" $ Ops.filterSome linearCount aheadly
43 , benchIO "breakAfterSome" $ Ops.breakAfterSome linearCount aheadly
47 [ benchIO "toNullAp" $ Ops.toNullAp linearCount asyncly
48 , benchIO "toNull" $ Ops.toNull linearCount asyncly
49 , benchIO "toNull3" $ Ops.toNull3 linearCount asyncly
50 -- , benchIO "toList" $ Ops.toList linearCount asyncly
51 , benchIO "toListSome" $ Ops.toListSome linearCount asyncly
52 , benchIO "filterAllOut" $ Ops.filterAllOut linearCount asyncly
53 , benchIO "filterAllIn" $ Ops.filterAllIn linearCount asyncly
54 , benchIO "filterSome" $ Ops.filterSome linearCount asyncly
55 , benchIO "breakAfterSome" $ Ops.breakAfterSome linearCount asyncly
59 [ benchIO "toNullAp" $ Ops.toNullAp linearCount wAsyncly
60 , benchIO "toNull" $ Ops.toNull linearCount wAsyncly
61 , benchIO "toNull3" $ Ops.toNull3 linearCount wAsyncly
62 -- , benchIO "toList" $ Ops.toList linearCount wAsyncly
63 , benchIO "toListSome" $ Ops.toListSome linearCount wAsyncly
64 , benchIO "filterAllOut" $ Ops.filterAllOut linearCount wAsyncly
65 , benchIO "filterAllIn" $ Ops.filterAllIn linearCount wAsyncly
66 , benchIO "filterSome" $ Ops.filterSome linearCount wAsyncly
67 , benchIO "breakAfterSome" $ Ops.breakAfterSome linearCount wAsyncly
71 [ benchIO "toNullAp" $ Ops.toNullAp linearCount zipAsyncly
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