GHC: Ticket #4403: Huge (10 times) increase of binaries produced by GHC 7.0.0 and GHC headhttp://ghc.haskell.org/trac/ghc/ticket/4403
<p>
When benchmarking Containers, I came over some suspicious increase of code size. I reduced the test case to the following:
</p>
<p>
Compile the following trivial benchmark:
</p>
<pre class="wiki">import Data.Set
import Criterion.Main
main = defaultMain [bench "set" (whnf (length . toList . fromList . concat . replicate 10) [1..1000])]
</pre><p>
The size of a stripped binary produced by ghc --make -O:
</p>
<pre class="wiki">ghc-6.12.1: 2414128
ghc-7.0.0.20100930: 22572260
ghc-7.1.20101010: 21417316
</pre><p>
That is nearly 10-times increase of code size. I could not figure out why. When using only 'base' package, there is nearly no increase in code size. The ghc-bundled libraries use -split-objs, the libraries compiled by cabal-install are not using -split-objs in any ghc version.
</p>
<p>
I used I386. The ghc-6.12.1 is precompiled binary, ghc-7.0.0 is compiled by ghc-6.12.1 by using default build system (configure &amp;&amp; make, no build.mk), ghc-7.1 is compiled by ghc-6.12.1 by using custom build.mk (but it only sets GhcLibWays=v).
</p>
<p>
The criterion package was compiled using 'cabal install criterion'. Latest version 0.5.0.4 was used (vector 0.7, vector-algorithms 0.3.3, statistics 0.8.0.1). For ghc-7.0 and ghc-7.1 some minor changes to the latest hackage versions of the deepseq, parallel, syb and vector-algorithms packages had to be made (trivial dependency changes, code that does not type check). SimonMar said some of that is already corrected in darcs repos.
</p>
<p>
Can anyone reproduce this behaviour? If so, it is horrible.
</p>
en-usGHChttp://ghc.haskell.org/trac/ghc/chrome/site/ghc_logo.pnghttp://ghc.haskell.org/trac/ghc/ticket/4403
Trac 1.0.7iglooFri, 15 Oct 2010 22:16:12 GMTstatus changed; resolution sethttp://ghc.haskell.org/trac/ghc/ticket/4403#comment:1
http://ghc.haskell.org/trac/ghc/ticket/4403#comment:1
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>closed</em>
</li>
<li><strong>resolution</strong>
set to <em>duplicate</em>
</li>
</ul>
<p>
This is because the <tt>ghc</tt> packages is used, and thus linked in, with ghc 7. See <a class="closed ticket" href="http://ghc.haskell.org/trac/ghc/ticket/4387" title="bug: Huge executables with GHC 7 (closed: fixed)">#4387</a> for more discussion.
</p>
Ticket