Fix fromStreamD performance

Before: not finishing in reasonable time
After: 686 us (similar to fromStream)
This commit is contained in:
Harendra Kumar 2021-02-16 01:26:18 +05:30
parent c8b9fac92b
commit 2c21267a6d
2 changed files with 2 additions and 2 deletions

View File

@ -590,7 +590,7 @@ o_1_space_generation size =
"generation"
[ benchIO "fromStream" $ fromStream size
, benchIO "fromStreamK" $ fromStreamK size
, benchIO "fromStreamD (n/100)" $ fromStreamD (size `div` 100)
, benchIO "fromStreamD" $ fromStreamD size
-- Very small benchmarks, reporting in ns
-- , benchIO "nilM" $ nilM size
, benchIO "consM" $ consM size

View File

@ -351,7 +351,7 @@ fromStreamD = Unfold step return
where
{-# INLINE_LATE step #-}
step (Stream step1 state1) = do
step (UnStream step1 state1) = do
r <- step1 defState state1
return $ case r of
Yield x s -> Yield x (Stream step1 s)