[GHC] #5642: Deriving Generic of a big type takes a long time and lots of space
GHC
cvs-ghc at haskell.org
Mon Apr 30 18:36:03 CEST 2012
#5642: Deriving Generic of a big type takes a long time and lots of space
---------------------------------+------------------------------------------
Reporter: basvandijk | Owner: dimitris
Type: bug | Status: new
Priority: high | Milestone: 7.6.1
Component: Compiler | Version: 7.3
Keywords: | Os: Unknown/Multiple
Architecture: Unknown/Multiple | Failure: Compile-time performance bug
Difficulty: Unknown | Testcase: T5642
Blockedby: | Blocking:
Related: |
---------------------------------+------------------------------------------
Changes (by simonpj):
* cc: dimitris@… (added)
* milestone: 7.4.2 => 7.6.1
Comment:
There is still something odd here. Here's the output for HEAD, doing `ghc
T5642.hs -dshow-passes +RTS -s`, for various sizes of input data type. If
you do it yourself you'll see that 99% of the time is spent in the
typechecker. The rest of compilation is fast.
So not only is it non-linear but the constant factor is terrible. It just
can't take that long to typecheck this stuff!
I'm punting for 7.4, but we need to look again for 7.6.
Simon
---------------------------
100 constructors
{{{
simonpj at cam-05-unx:~/tmp$ ~/5builds/HEAD/inplace/bin/ghc-stage2 -c
T5642.hs -dshow-passes +RTS -s
Glasgow Haskell Compiler, Version 7.5, stage 2 booted by GHC version 7.4.1
*** Checking old interface for main:T5642:
*** Parser:
*** Renamer/typechecker:
*** Desugar:
Result size of Desugar (after optimization)
= {terms: 3,498, types: 160,413, coercions: 1,305}
*** Simplifier:
Result size of Simplifier iteration=1
= {terms: 3,298, types: 110,113, coercions: 51,906}
Result size of Simplifier
= {terms: 3,298, types: 110,113, coercions: 51,805}
*** Tidy Core:
Result size of Tidy Core
= {terms: 3,298, types: 110,113, coercions: 51,805}
*** CorePrep:
Result size of CorePrep
= {terms: 4,642, types: 159,413, coercions: 51,805}
*** Stg2Stg:
*** CodeGen:
*** CodeOutput:
*** Assembler:
*** Deleting temp files:
Warning: deleting non-existent /tmp/ghc46808_0/ghc46808_0.c
*** Deleting temp dirs:
3,189,810,752 bytes allocated in the heap
1,176,054,736 bytes copied during GC
70,837,720 bytes maximum residency (19 sample(s))
1,225,552 bytes maximum slop
158 MB total memory in use (0 MB lost due to fragmentation)
Tot time (elapsed) Avg pause Max
pause
Gen 0 6039 colls, 0 par 1.99s 1.99s 0.0003s
0.0038s
Gen 1 19 colls, 0 par 1.45s 1.45s 0.0761s
0.2469s
TASKS: 3 (1 bound, 2 peak workers (2 total), using -N1)
SPARKS: 0 (0 converted, 0 overflowed, 0 dud, 0 GC'd, 0 fizzled)
INIT time 0.00s ( 0.00s elapsed)
MUT time 5.86s ( 5.95s elapsed)
GC time 3.44s ( 3.43s elapsed)
EXIT time 0.00s ( 0.00s elapsed)
Total time 9.29s ( 9.38s elapsed)
Alloc rate 544,723,338 bytes per MUT second
Productivity 63.0% of total user, 62.4% of total elapsed
}}}
--------------------------
150 constructors
{{{
simonpj at cam-05-unx:~/tmp$ ~/5builds/HEAD/inplace/bin/ghc-stage2 -c
T5642.hs -dshow-passes +RTS -s
Glasgow Haskell Compiler, Version 7.5, stage 2 booted by GHC version 7.4.1
*** Checking old interface for main:T5642:
*** Parser:
*** Renamer/typechecker:
*** Desugar:
Result size of Desugar (after optimization)
= {terms: 5,690, types: 401,601, coercions: 2,85}
*** Simplifier:
Result size of Simplifier iteration=1
= {terms: 5,370, types: 273,121, coercions: 131,46}
Result size of Simplifier
= {terms: 5,370, types: 273,121, coercions: 130,885}
*** Tidy Core:
Result size of Tidy Core
= {terms: 5,370, types: 273,121, coercions: 130,885}
*** CorePrep:
Result size of CorePrep
= {terms: 7,738, types: 400,1, coercions: 130,885}
*** Stg2Stg:
*** CodeGen:
*** CodeOutput:
*** Assembler:
*** Deleting temp files:
Warning: deleting non-existent /tmp/ghc47478_0/ghc47478_0.c
*** Deleting temp dirs:
8,336,602,152 bytes allocated in the heap
4,066,619,088 bytes copied during GC
218,323,536 bytes maximum residency (33 sample(s))
3,689,368 bytes maximum slop
479 MB total memory in use (0 MB lost due to fragmentation)
Tot time (elapsed) Avg pause Max
pause
Gen 0 15893 colls, 0 par 6.45s 6.45s 0.0004s
0.0033s
Gen 1 33 colls, 0 par 4.78s 4.78s 0.1448s
0.7436s
TASKS: 3 (1 bound, 2 peak workers (2 total), using -N1)
SPARKS: 0 (0 converted, 0 overflowed, 0 dud, 0 GC'd, 0 fizzled)
INIT time 0.00s ( 0.00s elapsed)
MUT time 24.45s ( 24.60s elapsed)
GC time 11.23s ( 11.23s elapsed)
EXIT time 0.00s ( 0.00s elapsed)
Total time 35.68s ( 35.82s elapsed)
Alloc rate 340,990,013 bytes per MUT second
Productivity 68.5% of total user, 68.3% of total elapsed
}}}
------------------------
200 constructors
{{{
*** Desugar:
Result size of Desugar (after optimization)
= {terms: 7,170, types: 622,561, coercions: 2,605}
*** Simplifier:
Result size of Simplifier iteration=1
= {terms: 6,770, types: 421,961, coercions: 203,806}
Result size of Simplifier
= {terms: 6,770, types: 421,961, coercions: 203,605}
*** Tidy Core:
Result size of Tidy Core
= {terms: 6,770, types: 421,961, coercions: 203,605}
*** CorePrep:
Result size of CorePrep
= {terms: 9,858, types: 620,561, coercions: 203,605}
*** Stg2Stg:
*** CodeGen:
*** CodeOutput:
*** Assembler:
*** Deleting temp files:
Warning: deleting non-existent /tmp/ghc47501_0/ghc47501_0.c
*** Deleting temp dirs:
13,262,925,720 bytes allocated in the heap
7,286,910,712 bytes copied during GC
298,657,992 bytes maximum residency (45 sample(s))
5,548,736 bytes maximum slop
640 MB total memory in use (0 MB lost due to fragmentation)
Tot time (elapsed) Avg pause Max
pause
Gen 0 25322 colls, 0 par 11.98s 11.97s 0.0005s
0.0034s
Gen 1 45 colls, 0 par 8.58s 8.59s 0.1908s
0.9460s
TASKS: 3 (1 bound, 2 peak workers (2 total), using -N1)
SPARKS: 0 (0 converted, 0 overflowed, 0 dud, 0 GC'd, 0 fizzled)
INIT time 0.00s ( 0.00s elapsed)
MUT time 50.07s ( 50.22s elapsed)
GC time 20.56s ( 20.55s elapsed)
EXIT time 0.00s ( 0.00s elapsed)
Total time 70.63s ( 70.78s elapsed)
Alloc rate 264,903,443 bytes per MUT second
Productivity 70.9% of total user, 70.7% of total elapsed
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5642#comment:14>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list