BT

Go 1.7 to Improve Compilation Speed and Generate Faster Code

| by Sergio De Simone Follow 14 Followers on Apr 21, 2016. Estimated reading time: 1 minute |

While Go 1.7 development cycle is approaching its next milestone, Go committer Dave Cheney has reported on the team's efforts to improve the language toolchain for the coming release.

Based on current development state, Go 1.7 will easily be the best Go release ever, Cheney says. Effort to improve its toolchain have been focusing on 2 areas:

  • compile and link times;
  • code generation.

When it comes to compile times, the Go compiler has suffered from slower performance since being ported from C to Go. This issue has seen a lot of discussions and recent work done towards Go 1.7 aimed to reduce the amount of memory used by the compiler and to improve linking time. This has led the overall compile time down by approximately 20–30% vs. Go 1.5.3, as the image below shows.

As it can be seen, Go 1.4.3 compiler performance is still significantly better than current 1.7. The importance of the current improvement should not be understated, though, given the fact that the new Go compiler includes a completely new code generation back end which is not yet necessarily mature when it comes to performance.

It should be also noted that the decision to bootstrap Go compiler was not related to performance, rather to the advantages that using Go instead of C would bring to its development, including ease of writing correct code and debugging, better tooling, support for parallelism, etc. In fact, Go compiler code has been automatically translated from its C code base, rather than rewritten from scratch.

Code generation, as mentioned above, is the other main focus area for Go 1.7. The new backend moved to using static single assignment form (SSA), as LLVM and other compilers do, to enable many optimizations to the generated code. Those include better dead code elimination, register allocation, stack frame allocation and more. As Cheney documented, Go 1.7 new SSA backend produces in this preliminary stage of development up to 20% faster code. Additionally, it generates smaller binaries in comparison with Go 1.6 and it is on a par with Go 1.4 in many cases.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT