Why does memory usage increase so much during CoreTidy?
I made GHC display the live data size before and after each pass and while compiling DynFlags, the live data size increased by almost 50% during the CoreTidy pass, even though the Core program size hardly changed:
...
Result size of Simplifier
= {terms: 104,494,
types: 264,683,
coercions: 15,760,
joins: 58/680}
!!! Simplifier [DynFlags]: 19.69 221248736: finished in 5337.48 milliseconds, allocated 4416.624 megabytes
*** Demand analysis [DynFlags]: 19.69 221248152:
Result size of Demand analysis
= {terms: 104,494,
types: 264,683,
coercions: 15,760,
joins: 58/680}
!!! Demand analysis [DynFlags]: 20.77 248604416: finished in 1349.45 milliseconds, allocated 2298.950 megabytes
*** CoreTidy [DynFlags]: 20.77 248603432:
Result size of Tidy Core
= {terms: 104,440,
types: 264,565,
coercions: 15,700,
joins: 58/679}
!!! CoreTidy [DynFlags]: 21.43 342594336: finished in 1124.37 milliseconds, allocated 736.209 megabytes
I find the amount of this increase surprising considering what CoreTidy does.
Trac metadata
Trac field | Value |
---|---|
Version | 8.1 |
Type | Task |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |