[GHC] #11545: Strictness signature blowup
GHC
ghc-devs at haskell.org
Fri Feb 5 17:09:50 UTC 2016
#11545: Strictness signature blowup
-------------------------------------+-------------------------------------
Reporter: jscholl | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.10.3
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: Compile-time
Unknown/Multiple | performance bug
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
The following code takes a lot of memory (556MB) to compile:
{{{#!hs
data A = A A A A A A deriving (Eq)
}}}
More {{{A}}}s result in more memory consumption during compilation. Using
{{{ghc -O A.hs -v -dverbose-core2core -c -ddump-simpl +RTS -s}}} it seems
like the strictness signatures of (==) and (/=) blow up quite a bit.
A less silly example could be the following:
{{{#!hs
data QuadTree a = QuadTree !Int [a] (QuadTree a) (QuadTree a) (QuadTree a)
(QuadTree a)
foldQuadTree :: (a -> b -> b) -> Int -> b -> QuadTree a -> b
foldQuadTree f maxSize = go
where
go z (QuadTree size elems t1 t2 t3 t4)
| size <= maxSize = foldr f z elems
| otherwise = go (go (go (go z t4) t3) t2) t1
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11545>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list