3-- Copyright : (c) 2018 Harendra Kumar
6-- Maintainer : harendra.kumar@gmail.com
8-- Rate benchmarks are kept separate because they need more running time to
9-- provide stable results.
11-- import Data.Functor.Identity (Identity, runIdentity)
12import System.Random (randomRIO)
13import qualified LinearOps as Ops
18-- | Takes a source, and uses it with a default drain/fold method.
19{-# INLINE benchSrcIO #-}
21 :: (t IO Int -> SerialT IO Int)
26 = bench name $ nfIO $ randomRIO (1,1) >>= Ops.toNull t . f
29_benchId :: NFData b => String -> (Ops.Stream m Int -> Identity b) -> Benchmark
30_benchId name f = bench name $ nf (runIdentity . f) (Ops.source 10)
36 -- XXX arbitrarily large rate should be the same as rate Nothing
39 [ -- benchIO "unfoldr" $ Ops.toNull asyncly
40 benchSrcIO asyncly "unfoldrM" Ops.sourceUnfoldrM
41 , benchSrcIO asyncly "unfoldrM/Nothing"
42 (rate Nothing . Ops.sourceUnfoldrM)
43 , benchSrcIO asyncly "unfoldrM/1,000,000"
44 (avgRate 1000000 . Ops.sourceUnfoldrM)
45 , benchSrcIO asyncly "unfoldrM/3,000,000"
46 (avgRate 3000000 . Ops.sourceUnfoldrM)
47 , benchSrcIO asyncly "unfoldrM/10,000,000/maxThreads1"
48 (maxThreads 1 . avgRate 10000000 . Ops.sourceUnfoldrM)
49 , benchSrcIO asyncly "unfoldrM/10,000,000"
50 (avgRate 10000000 . Ops.sourceUnfoldrM)
51 , benchSrcIO asyncly "unfoldrM/20,000,000"
52 (avgRate 20000000 . Ops.sourceUnfoldrM)
56 benchSrcIO aheadly "unfoldrM/1,000,000"
57 (avgRate 1000000 . Ops.sourceUnfoldrM)
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