
On Sun, Jul 23, 2017 at 6:26 PM, Artem
sumArr = scan (\acc x -> let !newAcc = acc + x in newAcc) 0 sumArr' = proc v -> do sumArr -< v
testData :: [Int] testData = [1..1000000]
main = print $ L.last $ evalList sumArr' testData
Running time for main with sumArr (i.e. no proc notation) is 0.087 sec, while for sumArr' it is 3.2 seconds (and around 300mb memory usage), although sumArr' is just sumArr called within a proc block.
Absent other information (like the core from each) I would be tempted to think that the problem is some stream fusion RULES either did not fire or degraded into a pessimization. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net