[GHC] #11415: Pandoc fails to build on 4 GB machine

#11415: Pandoc fails to build on 4 GB machine -------------------------------------+------------------------------------- Reporter: pavolzetor | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- I made an attempt to install pandoc on laptop with 4 GB RAM and GHC was killed by OS after using all RAM and swap space (512 MB). Output from 'emerge pandoc' http://lpaste.net/148881 I can tolerate slow compile times, however this bug makes it impossible to build some packages which is worse. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11415 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11415: Pandoc fails to build on 4 GB machine -------------------------------------+------------------------------------- Reporter: pavolzetor | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: GHC doesn't work | (amd64) at all | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by pavolzetor): * failure: None/Unknown => GHC doesn't work at all * os: Unknown/Multiple => Linux * architecture: Unknown/Multiple => x86_64 (amd64) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11415#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11415: Pandoc fails to build on 4 GB machine -------------------------------------+------------------------------------- Reporter: pavolzetor | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: GHC doesn't work | (amd64) at all | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by gidyn): * cc: gidyn (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11415#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11415: Pandoc fails to build on 4 GB machine -------------------------------------+------------------------------------- Reporter: pavolzetor | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by rwbarton): * failure: GHC doesn't work at all => Compile-time performance bug -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11415#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11415: Pandoc fails to build on 4 GB machine -------------------------------------+------------------------------------- Reporter: pavolzetor | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mpickering): This isn't about pandoc. The log you paste doesn't get to even trying to install pandoc. I conjecture that the problem is actually that another dependency (maybe texmath) takes up a lot of memory to compile which causes the OOM to appear when compiling pandoc-types which is relatively simple. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11415#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11415: pandoc-types fails to build on 4 GB machine -------------------------------------+------------------------------------- Reporter: pavolzetor | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by rwbarton): Actually the module `Text.Pandoc.Definition` is just expensive to build. For me (GHC 7.8.4) it takes about 25 seconds and 460M to build with optimizations. 7.10.1 fares significantly worse, about double on both metrics. (I think it is doing more inlining.) The main culprit seems to be the `FromJSON`/`ToJSON` which use generics. Commenting those out reduces the runtime by a factor of ~5 and the memory usage by a factor of ~3. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11415#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11415: pandoc-types fails to build on 4 GB machine -------------------------------------+------------------------------------- Reporter: pavolzetor | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Generics Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * keywords: => Generics -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11415#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11415: pandoc-types fails to build on 4 GB machine -------------------------------------+------------------------------------- Reporter: pavolzetor | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Generics Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by pavolzetor): I think it is related to this bug [https://github.com/bos/aeson/issues/296]. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11415#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11415: pandoc-types fails to build on 4 GB machine -------------------------------------+------------------------------------- Reporter: pavolzetor | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Generics Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by nh2): See also #11991 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11415#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

To test out the improvments, I did a very fast-and-loose profiling of
#11415: pandoc-types fails to build on 4 GB machine -------------------------------------+------------------------------------- Reporter: pavolzetor | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: fixed | Keywords: Generics Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * status: new => closed * resolution: => fixed Comment: In https://github.com/bos/aeson/pull/335#issue-127344930, RyanGlScott mentions: the time and memory it takes to compile `pandoc-types` (a package known to be affected badly by the aeson-0.10 compilation regressions).
The total wall time went from 10 minutes to under a minute, and it went from using 3 GB of RAM (and thrashing my laptop mercilessly) to about 500 MB of RAM.
pavolzetor: make sure you upgrade to the latest version of `aeson` to get those improvements. The //real// problem with Generics compile-time performance it still tracked in #5642. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11415#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC