Skip to content

GHC is bloated

I noticed today that our binary dists are getting bigger:

-rw-rw-r-- 1 simonmar GHC 118924739 2010-11-17 04:02 ghc-7.0.1-i386-unknown-linux.tar.bz2
-rw-rw-r-- 1 simonmar GHC 112074889 2011-03-02 04:19 ghc-7.0.2-i386-unknown-linux.tar.bz2
-rw-rw-r-- 1 simonmar GHC 109012585 2011-03-27 05:21 ghc-7.0.3-i386-unknown-linux.tar.bz2
-rw-rw-r-- 1 simonmar GHC 109012197 2011-06-15 04:25 ghc-7.0.4-i386-unknown-linux.tar.bz2
-rw-rw-r-- 1 simonmar GHC 115102248 2011-08-10 03:17 ghc-7.2.1-i386-unknown-linux.tar.bz2
-rw-rw-r-- 1 simonmar GHC 114428608 2011-11-10 04:28 ghc-7.2.2-i386-unknown-linux.tar.bz2
-rw-rw-r-- 1 simonmar GHC 123417972 2012-04-20 04:23 ghc-7.4.1.20120416-i386-unknown-linux.tar.bz2
-rw-rw-r-- 1 simonmar GHC 144861355 2012-04-18 06:25 ghc-7.5.20120413-i386-unknown-linux.tar.bz2

I looked into the difference between 7.0.4 and 7.4.1, and found that it seems to be mostly caused by GHC itself getting bigger:

-rwxrwxr-x simonmar/GHC 31280127 2011-06-14 19:59 ghc-7.0.4/ghc/stage2/build/tmp/ghc-stage2
-rwxrwxr-x simonmar/GHC 41050757 2012-04-19 20:12 ghc-7.4.1/ghc/stage2/build/tmp/ghc-stage2

the GHC binary is 25% larger, and the binary dist contains several copies of GHC (.a, _p.a, .so, the GHC binary, haddock).

We didn't add 25% more code to GHC between 7.0.4 and 7.4.1, so why is it 25% larger? This increase isn't reflected in other libraries - in fact, the base package is smaller in 7.4.1 than 7.0.4.

I have a horrid feeling that this is due to heavy use of INLINE/INLINABLE in containers, but I hope I'm wrong.

Trac metadata
Trac field Value
Version 7.4.1
Type Bug
TypeOfFailure OtherFailure
Priority high
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC milan, tibbe
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information