summaryrefslogtreecommitdiff
path: root/compiler/basicTypes/Demand.hs
diff options
context:
space:
mode:
authorReid Barton <rwbarton@gmail.com>2017-04-01 11:51:59 -0400
committerBen Gamari <ben@smart-cactus.org>2017-04-01 12:31:59 -0400
commitf2b10f35a053e595fd309f523c5e93f619d2ec3a (patch)
tree1c4ebdc9c61b3c48d85eca4c33d40736fbbb3581 /compiler/basicTypes/Demand.hs
parent3b5f786c7257298657fd34b3840d8cf6da968ef6 (diff)
downloadhaskell-f2b10f35a053e595fd309f523c5e93f619d2ec3a.tar.gz
Stamp out space leaks from demand analysis
This reduces peak memory usage by ~30% on my test case (DynFlags), and (probably as a result of reduced GC work) decreases compilation time by a few percent as well. Also fix a bug in seqStrDmd so that demeand info is fully evaluated. Reviewers: simonpj, austin, bgamari Reviewed By: bgamari Subscribers: dfeuer, thomie Differential Revision: https://phabricator.haskell.org/D3400
Diffstat (limited to 'compiler/basicTypes/Demand.hs')
-rw-r--r--compiler/basicTypes/Demand.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/basicTypes/Demand.hs b/compiler/basicTypes/Demand.hs
index 377fc3d6ea..95c7b79b4f 100644
--- a/compiler/basicTypes/Demand.hs
+++ b/compiler/basicTypes/Demand.hs
@@ -332,7 +332,7 @@ bothStr (SProd _) (SCall _) = HyperStr
-- utility functions to deal with memory leaks
seqStrDmd :: StrDmd -> ()
seqStrDmd (SProd ds) = seqStrDmdList ds
-seqStrDmd (SCall s) = s `seq` ()
+seqStrDmd (SCall s) = seqStrDmd s
seqStrDmd _ = ()
seqStrDmdList :: [ArgStr] -> ()