#4270: Out of memory when compiling Statistics.Quantile
-------------------------------+--------------------------------------------
Reporter: Itkovian | Owner:
Type: bug | Status: new
Priority: highest | Milestone: 7.0.1
Component: Compiler | Version: 6.13
Keywords: Out-of-memory | Testcase: Statistics.Quantile
Blockedby: | Difficulty:
Os: Linux | Blocking:
Architecture: x86_64 (amd64) | Failure: Compile-time crash
-------------------------------+--------------------------------------------
Changes (by simonpj):
* cc: roman.leshchins...@… (added)
Comment:
The culprit is `zipWithM`. It generates quite a lot of code. In the
examples we make lots of copies of it, which dramatically increases the
size of the modules.
Moreover, the functions are all monadic, so inlining them doensn't help
much unless we know which monad. And in `tiny.hs` and `small.hs`, we
don't.
The HEAD is worse than 6.12 in these examples because it (HEAD) optimises
an INLINE function f, and generates code for it, just in case it appears
in the form `map f xs`. That seems ok to me.
I don't see quite what to do about this. If you want to duplicate all the
code for `zipWithM` at every call site, you're going to get lots of code.
Are you sure you want this much duplication?
I guess the offending `zipWithM` may originally come from `vector`, so we
need advice from Roman.
The main thought I have is that
* we might mark `zipWithM` as INLINABLE
* then in calling modules we might auto-SPECIALISE any INLINABLE imported
functions
But that still might not do the job if you want to not only specialise
`zipWithM` but also inline the specialised function at all its call sites.
Roman?
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4270#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs