title: Why are binaries built with gccgo smaller (among other differences?)
body: <p>I've been experimenting with gc and gccgo, and I've encountered some odd behaviour.</p>
  
  <p>Using a <a href="https://gist.github.com/evertheylen/df80a46fd7c96215af62" rel="nofollow noreferrer">program</a> I once wrote to test some theorem, I got these results: (I removed unnecessary information for readablitity)</p>
  
  <pre><code>$ time go build -compiler gc -o checkprog_gc checkprog.go (x 3)
  go build &lt;...&gt;    0.13s user 0.02s system 100% cpu 0.149 total
  go build &lt;...&gt;    0.13s user 0.01s system 99%  cpu 0.148 total
  go build &lt;...&gt;    0.14s user 0.03s system 100% cpu 0.162 total
   --&gt; average:     0.13s user 0.02s system 100% cpu 0.153 total
  
  
  $ time go build -compiler gccgo -o checkprog_gccgo checkprog.go (x 3)
  go build &lt;...&gt;    0.10s user 0.03s system 96% cpu 0.135 total
  go build &lt;...&gt;    0.12s user 0.01s system 96% cpu 0.131 total
  go build &lt;...&gt;    0.10s user 0.01s system 92% cpu 0.123 total
   --&gt; average:     0.11s user 0.02s system 95% cpu 0.130 total
  
  
  $ strip -s -o checkprog_gc_stripped checkprog_gc
  $ strip -s -o checkprog_gccgo_stripped checkprog_gccgo
  
  $ ls -l
   1834504 checkprog_gc*
   1336992 checkprog_gc_stripped*
     35072 checkprog_gccgo*
     24192 checkprog_gccgo_stripped*
  
  $ time ./checkprog_gc
  ./checkprog_gc  6.68s user 0.01s system 100% cpu 6.674 total
  ./checkprog_gc  6.75s user 0.01s system 100% cpu 6.741 total
  ./checkprog_gc  6.66s user 0.00s system 100% cpu 6.643 total
   --&gt; average:   6.70s user 0.01s system 100% cpu 6.686 total
  
  $ time ./checkprog_gccgo
  ./checkprog_gccgo  10.95s user 0.02s system 100% cpu 10.949 total
  ./checkprog_gccgo  10.98s user 0.01s system 100% cpu 10.964 total
  ./checkprog_gccgo  10.94s user 0.01s system 100% cpu 10.929 total
   --&gt; average       10.96s user 0.01s system 100% cpu 10.947 total
  </code></pre>
  
  <p>I can see the following patterns:</p>
  
  <ol>
  <li>Binaries built with <code>gccgo</code> are radically smaller in size (and stripping doesn't help to change this difference)</li>
  <li>Binaries built with <code>gc</code> are faster to execute</li>
  <li>It takes a bit more time to build with <code>gccgo</code> than with <code>gc</code></li>
  </ol>
  
  <p>I also tested some other go programs (while not that extensively) and all of them exhibit the same behavior.</p>
  
  <p>This seems to contradict what <a href="https://stackoverflow.com/a/25811505/2678118">this answer</a> states:</p>
  
  <blockquote>
    <p>In short: <strong>gccgo: more optimization, more processors.</strong></p>
  </blockquote>
  
  <p>I'd think that more optimization means faster binaries, while needing more time to compile...</p>
  
  <p><strong>What's the reason these three patterns?</strong></p>