[GHC] #7206: Implement cheap build
GHC
ghc-devs at haskell.org
Thu Aug 28 08:50:19 UTC 2014
#7206: Implement cheap build
-------------------------------------+-------------------------------------
Reporter: simonpj | Owner: simonpj
Type: bug | Status: new
Priority: normal | Milestone: ⊥
Component: Compiler | Version: 7.4.2
Resolution: | Keywords:
Operating System: | Architecture: Unknown/Multiple
Unknown/Multiple | Difficulty: Unknown
Type of failure: | Blocked By:
None/Unknown | Related Tickets:
Test Case: |
Blocking: |
Differential Revisions: |
-------------------------------------+-------------------------------------
Changes (by snoyberg):
* cc: snoyberg (added)
Comment:
Following up on a separate discussion on the haskell-cafe, I have a
possibly related case:
{{{#!hs
main :: IO ()
main = printLen >> printLen
printLen :: IO ()
printLen = lengthM 0 [1..40000000 :: Int] >>= print
lengthM :: Monad m => Int -> [a] -> m Int
lengthM cnt [] = return cnt
lengthM cnt (_:xs) =
cnt' `seq` lengthM cnt' xs
where
cnt' = cnt + 1
}}}
On my system, this takes almost 1.2GB of memory. If I comment out the
second call to `printLen`, it takes 44KB.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/7206#comment:10>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list