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 runMode (mode cfg) cfg benches
34 [ benchIO "toNullAp" $ Ops.toNullAp linearCount serially
35 , benchIO "toNull" $ Ops.toNull linearCount serially
36 , benchIO "toNull3" $ Ops.toNull3 linearCount serially
37 , benchIO "toList" $ Ops.toList linearCount serially
38 -- , benchIO "toListSome" $ Ops.toListSome serially
39 , benchIO "filterAllOut" $ Ops.filterAllOut linearCount serially
40 , benchIO "filterAllIn" $ Ops.filterAllIn linearCount serially
41 , benchIO "filterSome" $ Ops.filterSome linearCount serially
42 , benchIO "breakAfterSome" $ Ops.breakAfterSome linearCount serially
46 [ benchIO "toNullAp" $ Ops.toNullAp linearCount wSerially
47 , benchIO "toNull" $ Ops.toNull linearCount wSerially
48 , benchIO "toNull3" $ Ops.toNull3 linearCount wSerially
49 , benchIO "toList" $ Ops.toList linearCount wSerially
50 -- , benchIO "toListSome" $ Ops.toListSome wSerially
51 , benchIO "filterAllOut" $ Ops.filterAllOut linearCount wSerially
52 , benchIO "filterAllIn" $ Ops.filterAllIn linearCount wSerially
53 , benchIO "filterSome" $ Ops.filterSome linearCount wSerially
54 , benchIO "breakAfterSome" $ Ops.breakAfterSome linearCount wSerially
57 , bgroup "zipSerially"
58 [ benchIO "toNullAp" $ Ops.toNullAp linearCount zipSerially
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