[GHC] #11380: Compiling a 10.000 line file exhausts memory

GHC ghc-devs at haskell.org
Sun Dec 24 23:05:56 UTC 2017


#11380: Compiling a 10.000 line file exhausts memory
-------------------------------------+-------------------------------------
        Reporter:  kennethb          |                Owner:  (none)
            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 AndreasK):

 This regressed farther in 8.2.2 and 8.0.2 (at -O1)

 Compiling the project in GHC-8.2.2 takes forever (~10 Hours on an
 i7-6700).

 Ram usage for compile or ghci didn't go over 3GB in the first 10 Minutes
 but I stopped watching it afterwards. So the compile time of ~10h could
 have been a result of my machine running out of ram.

 With 7.10.3 compiling takes less than two Minutes.

 GHC-8.0.2 (stackage lts-9.20) probably has the same behaviour as 8.2.2 but
 I didn't wait around for it to finish. Using the same lts with ghc-7.10.3
 works fine.

 Logs for build/ghci with 8.2.2:
 [https://github.com/AndreasPK/pyn/tree/f77f9454aa424545b2ce8bfb460d8d275edda956
 repo for repro]

 {{{
 Compiled (-O1)

 [17 of 20] Compiling Language.Python.Pyn.Parser.Parser ( .stack-
 work\dist\5c8418a7\build\Language\Python\Pyn\Parser\Parser.hs, .stack-
 work\dist\5c8418a7\build\Language\Python\Pyn\Parser\Parser.o )
 *** Checking old interface for Language.Python.Pyn.Lexer (use -ddump-hi-
 diffs for more details):
 *** Deleting temp files:
 Deleting:
 compile: input file
 C:\Users\Andi\AppData\Local\Temp\ghc81932_0\ghc_7.hscpp
 *** Checking old interface for Language.Python.Pyn.Parser.Parser (use
 -ddump-hi-diffs for more details):
 *** Parser [Language.Python.Pyn.Parser.Parser]:
 !!! Parser [Language.Python.Pyn.Parser.Parser]: finished in 937.50
 milliseconds, allocated 2647.317 megabytes
 *** Renamer/typechecker [Language.Python.Pyn.Parser.Parser]:
 !!! Renamer/typechecker [Language.Python.Pyn.Parser.Parser]: finished in
 35763203.12 milliseconds, allocated 109977425.131 megabytes
 *** Desugar [Language.Python.Pyn.Parser.Parser]:
 Result size of Desugar (after optimization)
   = {terms: 83,551,
      types: 2,023,928,
      coercions: 76,061,
      joins: 1/136}



 Interpreter:

 [17 of 21] Compiling Language.Python.Pyn.Parser.Parser ( C:\test\pyn
 \.stack-work\dist\5c8418a7\build\Language\Python\Pyn\Parser\Parser.hs,
 interpreted )
 *** Parser [Language.Python.Pyn.Parser.Parser]:
 !!! Parser [Language.Python.Pyn.Parser.Parser]: finished in 890.62
 milliseconds, allocated 2646.366 megabytes
 *** Renamer/typechecker [Language.Python.Pyn.Parser.Parser]:
 !!! Renamer/typechecker [Language.Python.Pyn.Parser.Parser]: finished in
 35747375.00 milliseconds, allocated 109978920.259 megabytes
 *** Desugar [Language.Python.Pyn.Parser.Parser]:
 Result size of Desugar (after optimization)
   = {terms: 217,920,
      types: 3,341,879,
      coercions: 76,475,
      joins: 0/653}
 }}}

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11380#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list