mirror of
https://github.com/composewell/streamly.git
synced 2024-10-06 15:58:20 +03:00
Do not run each individual stream action with captured state
We already run the whole thread with captured monad state (in doFork). Running with captured state in parallel stream is unnecessary. This leads to buildup of memory on thread stack and memory keeps growing continuously. Also with the removal of this call we are at 8 seconds vs 34 seconds in concatMapBy parallel benchmark.
This commit is contained in:
parent
90161e172e
commit
debe27702f
@ -81,7 +81,6 @@ runOne st m0 winfo = go m0
|
||||
else liftIO $ cleanupSVarFromWorker sv
|
||||
|
||||
sv = fromJust $ streamVar st
|
||||
mrun = runInIO $ svarMrun sv
|
||||
|
||||
stop = liftIO $ do
|
||||
incrementBufferLimit sv
|
||||
@ -89,7 +88,7 @@ runOne st m0 winfo = go m0
|
||||
sendStop sv winfo
|
||||
sendit a = liftIO $ void $ send sv (ChildYield a)
|
||||
single a = sendit a >> (liftIO $ sendStop sv winfo)
|
||||
yieldk a r = sendit a >> (void $ liftIO $ mrun $ go r)
|
||||
yieldk a r = sendit a >> go r
|
||||
|
||||
{-# NOINLINE forkSVarPar #-}
|
||||
forkSVarPar :: (IsStream t, MonadAsync m)
|
||||
|
Loading…
Reference in New Issue
Block a user