Talk:Go

From ArchWiki
Latest comment: 11 April 2020 by Skyfaller in topic gccgo vs gc

gccgo vs gc

The gccgo compiler (from gcc-go) is usually slower to compile but generally has more optimizations than the gc compiler (from go).

The Go language has always been defined by a spec, not an implementation. The Go team has written two different compilers that implement that spec: gc and gccgo.
  • Gc is the original compiler, and the go tool uses it by default.
  • Gccgo is a different implementation with a different focus
Compared to gc, gccgo is slower to compile code but supports more powerful optimizations, so a CPU-bound program built by gccgo will usually run faster.
The gc compiler supports only the most popular processors: x86 (32-bit and 64-bit) and ARM.
Gccgo, however, supports all the processors that GCC supports.
Not all those processors have been thoroughly tested for gccgo, but many have, including x86 (32-bit and 64-bit), SPARC, MIPS, PowerPC and even Alpha.
Gccgo has also been tested on operating systems that the gc compiler does not support, notably Solaris.
Gccgo in GCC 4.7.1 (July 2012, slightly reformatted for clarity)

-- The Puzzlemaker (talk) 04:46, 8 March 2020 (UTC)Reply[reply]

Recent 2019 benchmarks appear to show that gc has improved more quickly than gccgo has (probably because it's received more attention), so even though gccgo has made significant improvements, gc seems like the better choice in most circumstances: https://meltware.com/2019/01/16/gccgo-benchmarks-2019.html Skyfaller (talk) 12:52, 11 April 2020 (UTC)Reply[reply]