on master help sign in
Fix naming changes in benchmarks
c8b32f2Harendra Kumar
benchmark/Linear.hs+5−5
@@ -50,11 +50,11 @@ main = do
50 ]
50 ]
51 , benchIO "zip" Ops.zip
51 , benchIO "zip" Ops.zip
52 , bgroup "append"
52 , bgroup "append"
53− [ benchIOAppend "stream" $ Ops.append asStream
53+ [ benchIOAppend "serially" $ Ops.append serially
54− , benchIOAppend "costream" $ Ops.append asCostream
54+ , benchIOAppend "wSerially" $ Ops.append wSerially
55− , benchIOAppend "parAhead" $ Ops.append asParAhead
55+ , benchIOAppend "asyncly" $ Ops.append asyncly
56− , benchIOAppend "coparAhead" $ Ops.append asCoparAhead
56+ , benchIOAppend "wAsyncly" $ Ops.append wAsyncly
57− , benchIOAppend "parallel" $ Ops.append asParallel
57+ , benchIOAppend "parallely" $ Ops.append parallely
58 ]
58 ]
59 , bgroup "compose"
59 , bgroup "compose"
60 [ benchIO "mapM" Ops.composeMapM
60 [ benchIO "mapM" Ops.composeMapM
benchmark/LinearOps.hs+2−2
@@ -59,7 +59,7 @@ last :: Monad m => Stream m Int -> m (Maybe Int)
59-- Stream generation and elimination
59-- Stream generation and elimination
60-------------------------------------------------------------------------------
60-------------------------------------------------------------------------------
61
61
62−type Stream m a = S.StreamT m a
62+type Stream m a = S.SerialT m a
63
63
64source :: Int -> Stream m Int
64source :: Int -> Stream m Int
65source n = S.fromFoldable [n..n+value]
65source n = S.fromFoldable [n..n+value]
@@ -111,7 +111,7 @@ concat _n = return ()
111{-# INLINE append #-}
111{-# INLINE append #-}
112append
112append
113 :: (Monoid (t m Int), Monad m, Monad (t m))
113 :: (Monoid (t m Int), Monad m, Monad (t m))
114− => (t m Int -> S.StreamT m Int) -> Int -> m ()
114+ => (t m Int -> S.SerialT m Int) -> Int -> m ()
115append t n = runStream $ t $ foldMap return [n..n+appendValue]
115append t n = runStream $ t $ foldMap return [n..n+appendValue]
116
116
117-------------------------------------------------------------------------------
117-------------------------------------------------------------------------------
benchmark/Nested.hs+57−44
@@ -27,55 +27,68 @@ main = do
27 , benchIO "toListLinear" Ops.toListLinear
27 , benchIO "toListLinear" Ops.toListLinear
28 ]
28 ]
29
29
30− , bgroup "asStream"
30+ , bgroup "serially"
31− [ benchIO "append" $ Ops.append asStream
31+ [ benchIO "append" $ Ops.append serially
32− , benchIO "toNull0" $ Ops.toNull0 asStream
32+ , benchIO "toNull0" $ Ops.toNull0 serially
33− , benchIO "toList0" $ Ops.toList0 asStream
33+ , benchIO "toList0" $ Ops.toList0 serially
34− , benchIO "toNull" $ Ops.toNull asStream
34+ , benchIO "toNull" $ Ops.toNull serially
35− , benchIO "toList" $ Ops.toList asStream
35+ , benchIO "toList" $ Ops.toList serially
36− , benchIO "toListSome" $ Ops.toListSome asStream
36+ , benchIO "toListSome" $ Ops.toListSome serially
37− , benchIO "filterAllOut" $ Ops.filterAllOut asStream
37+ , benchIO "filterAllOut" $ Ops.filterAllOut serially
38− , benchIO "filterAllIn" $ Ops.filterAllIn asStream
38+ , benchIO "filterAllIn" $ Ops.filterAllIn serially
39− , benchIO "filterSome" $ Ops.filterSome asStream
39+ , benchIO "filterSome" $ Ops.filterSome serially
40− , benchIO "breakAfterSome" $ Ops.breakAfterSome asStream
40+ , benchIO "breakAfterSome" $ Ops.breakAfterSome serially
41 ]
41 ]
42
42
43− , bgroup "asCostream"
43+ , bgroup "wSerially"
44− [ benchIO "append" $ Ops.append asCostream
44+ [ benchIO "append" $ Ops.append wSerially
45− , benchIO "toNull0" $ Ops.toNull0 asCostream
45+ , benchIO "toNull0" $ Ops.toNull0 wSerially
46− , benchIO "toList0" $ Ops.toList0 asCostream
46+ , benchIO "toList0" $ Ops.toList0 wSerially
47− , benchIO "toNull" $ Ops.toNull asCostream
47+ , benchIO "toNull" $ Ops.toNull wSerially
48− , benchIO "toList" $ Ops.toList asCostream
48+ , benchIO "toList" $ Ops.toList wSerially
49− , benchIO "toListSome" $ Ops.toListSome asCostream
49+ , benchIO "toListSome" $ Ops.toListSome wSerially
50− , benchIO "filterAllOut" $ Ops.filterAllOut asCostream
50+ , benchIO "filterAllOut" $ Ops.filterAllOut wSerially
51− , benchIO "filterAllIn" $ Ops.filterAllIn asCostream
51+ , benchIO "filterAllIn" $ Ops.filterAllIn wSerially
52− , benchIO "filterSome" $ Ops.filterSome asCostream
52+ , benchIO "filterSome" $ Ops.filterSome wSerially
53− , benchIO "breakAfterSome" $ Ops.breakAfterSome asCostream
53+ , benchIO "breakAfterSome" $ Ops.breakAfterSome wSerially
54 ]
54 ]
55
55
56− , bgroup "CoasCoparAhead"
56+ , bgroup "asyncly"
57− [ benchIO "append" $ Ops.append asParAhead
57+ [ benchIO "append" $ Ops.append asyncly
58− , benchIO "toNull0" $ Ops.toNull0 asParAhead
58+ , benchIO "toNull0" $ Ops.toNull0 asyncly
59− , benchIO "toList0" $ Ops.toList0 asParAhead
59+ , benchIO "toList0" $ Ops.toList0 asyncly
60− , benchIO "toNull" $ Ops.toNull asParAhead
60+ , benchIO "toNull" $ Ops.toNull asyncly
61− , benchIO "toList" $ Ops.toList asParAhead
61+ , benchIO "toList" $ Ops.toList asyncly
62− , benchIO "toListSome" $ Ops.toListSome asParAhead
62+ , benchIO "toListSome" $ Ops.toListSome asyncly
63− , benchIO "filterAllOut" $ Ops.filterAllOut asParAhead
63+ , benchIO "filterAllOut" $ Ops.filterAllOut asyncly
64− , benchIO "filterAllIn" $ Ops.filterAllIn asParAhead
64+ , benchIO "filterAllIn" $ Ops.filterAllIn asyncly
65− , benchIO "filterSome" $ Ops.filterSome asParAhead
65+ , benchIO "filterSome" $ Ops.filterSome asyncly
66− , benchIO "breakAfterSome" $ Ops.breakAfterSome asParAhead
66+ , benchIO "breakAfterSome" $ Ops.breakAfterSome asyncly
67 ]
67 ]
68
68
69− , bgroup "Parallely"
69+ , bgroup "wAsyncly"
70− [ benchIO "append" $ Ops.append asCoparAhead
70+ [ benchIO "append" $ Ops.append wAsyncly
71− , benchIO "toNull0" $ Ops.toNull0 asCoparAhead
71+ , benchIO "toNull0" $ Ops.toNull0 wAsyncly
72− , benchIO "toList0" $ Ops.toList0 asCoparAhead
72+ , benchIO "toList0" $ Ops.toList0 wAsyncly
73− , benchIO "toNull" $ Ops.toNull asCoparAhead
73+ , benchIO "toNull" $ Ops.toNull wAsyncly
74− , benchIO "toList" $ Ops.toList asCoparAhead
74+ , benchIO "toList" $ Ops.toList wAsyncly
75− , benchIO "toListSome" $ Ops.toListSome asCoparAhead
75+ , benchIO "toListSome" $ Ops.toListSome wAsyncly
76− , benchIO "filterAllOut" $ Ops.filterAllOut asCoparAhead
76+ , benchIO "filterAllOut" $ Ops.filterAllOut wAsyncly
77− , benchIO "filterAllIn" $ Ops.filterAllIn asCoparAhead
77+ , benchIO "filterAllIn" $ Ops.filterAllIn wAsyncly
78− , benchIO "filterSome" $ Ops.filterSome asCoparAhead
78+ , benchIO "filterSome" $ Ops.filterSome wAsyncly
79− , benchIO "breakAfterSome" $ Ops.breakAfterSome asCoparAhead
79+ , benchIO "breakAfterSome" $ Ops.breakAfterSome wAsyncly
80+ ]
81+
82+ , bgroup "parallely"
83+ [ benchIO "append" $ Ops.append parallely
84+ , benchIO "toNull0" $ Ops.toNull0 parallely
85+ , benchIO "toList0" $ Ops.toList0 parallely
86+ , benchIO "toNull" $ Ops.toNull parallely
87+ , benchIO "toList" $ Ops.toList parallely
88+ , benchIO "toListSome" $ Ops.toListSome parallely
89+ , benchIO "filterAllOut" $ Ops.filterAllOut parallely
90+ , benchIO "filterAllIn" $ Ops.filterAllIn parallely
91+ , benchIO "filterSome" $ Ops.filterSome parallely
92+ , benchIO "breakAfterSome" $ Ops.breakAfterSome parallely
80 ]
93 ]
81 ]
94 ]
benchmark/NestedOps.hs+11−11
@@ -25,7 +25,7 @@ prodCount = 1000
25-- Stream generation and elimination
25-- Stream generation and elimination
26-------------------------------------------------------------------------------
26-------------------------------------------------------------------------------
27
27
28−type Stream m a = S.StreamT m a
28+type Stream m a = S.SerialT m a
29
29
30{-# INLINE source #-}
30{-# INLINE source #-}
31source :: S.IsStream t => Int -> Int -> t m Int
31source :: S.IsStream t => Int -> Int -> t m Int
@@ -54,13 +54,13 @@ toListLinear start = runToList $ source start sumCount
54{-# INLINE append #-}
54{-# INLINE append #-}
55append
55append
56 :: (Monoid (t m Int), Monad m, Monad (t m))
56 :: (Monoid (t m Int), Monad m, Monad (t m))
57− => (t m Int -> S.StreamT m Int) -> Int -> m ()
57+ => (t m Int -> S.SerialT m Int) -> Int -> m ()
58append t start = runStream $ t $ foldMap return [start..start+sumCount]
58append t start = runStream $ t $ foldMap return [start..start+sumCount]
59
59
60{-# INLINE toNull0 #-}
60{-# INLINE toNull0 #-}
61toNull0
61toNull0
62 :: (S.IsStream t, Monad m, Monad (t m))
62 :: (S.IsStream t, Monad m, Monad (t m))
63− => (t m (Int, Int) -> S.StreamT m (Int, Int)) -> Int -> m ()
63+ => (t m (Int, Int) -> S.SerialT m (Int, Int)) -> Int -> m ()
64toNull0 t start = runStream . t $ do
64toNull0 t start = runStream . t $ do
65 x <- source start prodCount
65 x <- source start prodCount
66 y <- source start prodCount
66 y <- source start prodCount
@@ -69,7 +69,7 @@ toNull0 t start = runStream . t $ do
69{-# INLINE toList0 #-}
69{-# INLINE toList0 #-}
70toList0
70toList0
71 :: (S.IsStream t, Monad m, Monad (t m))
71 :: (S.IsStream t, Monad m, Monad (t m))
72− => (t m (Int, Int) -> S.StreamT m (Int, Int)) -> Int -> m [(Int, Int)]
72+ => (t m (Int, Int) -> S.SerialT m (Int, Int)) -> Int -> m [(Int, Int)]
73toList0 t start = runToList . t $ do
73toList0 t start = runToList . t $ do
74 x <- source start prodCount
74 x <- source start prodCount
75 y <- source start prodCount
75 y <- source start prodCount
@@ -78,7 +78,7 @@ toList0 t start = runToList . t $ do
78{-# INLINE toNull #-}
78{-# INLINE toNull #-}
79toNull
79toNull
80 :: (S.IsStream t, Monad m, Monad (t m))
80 :: (S.IsStream t, Monad m, Monad (t m))
81− => (t m Int -> S.StreamT m Int) -> Int -> m ()
81+ => (t m Int -> S.SerialT m Int) -> Int -> m ()
82toNull t start = runStream . t $ do
82toNull t start = runStream . t $ do
83 x <- source start prodCount
83 x <- source start prodCount
84 y <- source start prodCount
84 y <- source start prodCount
@@ -87,7 +87,7 @@ toNull t start = runStream . t $ do
87{-# INLINE toList #-}
87{-# INLINE toList #-}
88toList
88toList
89 :: (S.IsStream t, Monad m, Monad (t m))
89 :: (S.IsStream t, Monad m, Monad (t m))
90− => (t m Int -> S.StreamT m Int) -> Int -> m [Int]
90+ => (t m Int -> S.SerialT m Int) -> Int -> m [Int]
91toList t start = runToList . t $ do
91toList t start = runToList . t $ do
92 x <- source start prodCount
92 x <- source start prodCount
93 y <- source start prodCount
93 y <- source start prodCount
@@ -96,7 +96,7 @@ toList t start = runToList . t $ do
96{-# INLINE toListSome #-}
96{-# INLINE toListSome #-}
97toListSome
97toListSome
98 :: (S.IsStream t, Monad m, Monad (t m))
98 :: (S.IsStream t, Monad m, Monad (t m))
99− => (t m Int -> S.StreamT m Int) -> Int -> m [Int]
99+ => (t m Int -> S.SerialT m Int) -> Int -> m [Int]
100toListSome t start =
100toListSome t start =
101 runToList . t $ S.take 1000 $ do
101 runToList . t $ S.take 1000 $ do
102 x <- source start prodCount
102 x <- source start prodCount
@@ -106,7 +106,7 @@ toListSome t start =
106{-# INLINE filterAllOut #-}
106{-# INLINE filterAllOut #-}
107filterAllOut
107filterAllOut
108 :: (S.IsStream t, Monad m, Monad (t m))
108 :: (S.IsStream t, Monad m, Monad (t m))
109− => (t m Int -> S.StreamT m Int) -> Int -> m ()
109+ => (t m Int -> S.SerialT m Int) -> Int -> m ()
110filterAllOut t start = runStream . t $ do
110filterAllOut t start = runStream . t $ do
111 x <- source start prodCount
111 x <- source start prodCount
112 y <- source start prodCount
112 y <- source start prodCount
@@ -118,7 +118,7 @@ filterAllOut t start = runStream . t $ do
118{-# INLINE filterAllIn #-}
118{-# INLINE filterAllIn #-}
119filterAllIn
119filterAllIn
120 :: (S.IsStream t, Monad m, Monad (t m))
120 :: (S.IsStream t, Monad m, Monad (t m))
121− => (t m Int -> S.StreamT m Int) -> Int -> m ()
121+ => (t m Int -> S.SerialT m Int) -> Int -> m ()
122filterAllIn t start = runStream . t $ do
122filterAllIn t start = runStream . t $ do
123 x <- source start prodCount
123 x <- source start prodCount
124 y <- source start prodCount
124 y <- source start prodCount
@@ -130,7 +130,7 @@ filterAllIn t start = runStream . t $ do
130{-# INLINE filterSome #-}
130{-# INLINE filterSome #-}
131filterSome
131filterSome
132 :: (S.IsStream t, Monad m, Monad (t m))
132 :: (S.IsStream t, Monad m, Monad (t m))
133− => (t m Int -> S.StreamT m Int) -> Int -> m ()
133+ => (t m Int -> S.SerialT m Int) -> Int -> m ()
134filterSome t start = runStream . t $ do
134filterSome t start = runStream . t $ do
135 x <- source start prodCount
135 x <- source start prodCount
136 y <- source start prodCount
136 y <- source start prodCount
@@ -142,7 +142,7 @@ filterSome t start = runStream . t $ do
142{-# INLINE breakAfterSome #-}
142{-# INLINE breakAfterSome #-}
143breakAfterSome
143breakAfterSome
144 :: (S.IsStream t, Monad (t IO))
144 :: (S.IsStream t, Monad (t IO))
145− => (t IO Int -> S.StreamT IO Int) -> Int -> IO ()
145+ => (t IO Int -> S.SerialT IO Int) -> Int -> IO ()
146breakAfterSome t start = do
146breakAfterSome t start = do
147 (_ :: Either ErrorCall ()) <- try $ runStream . t $ do
147 (_ :: Either ErrorCall ()) <- try $ runStream . t $ do
148 x <- source start prodCount
148 x <- source start prodCount