How does Go compile so quickly?

Issue

I’ve Googled and poked around the Go website, but I can’t find an explanation for Go’s extraordinary build times. Are they products of the language features (or lack thereof), a highly optimized compiler, or something else? I’m not trying to promote Go; I’m just curious.

Solution

Dependency analysis.

The Go FAQ used to contain the following sentence:

Go provides a model for software
construction that makes dependency
analysis easy and avoids much of the
overhead of C-style include files and
libraries.

While the phrase is not in the FAQ anymore, this topic is elaborated upon in the talk Go at Google, which compares the dependency analysis approach of C/C++ and Go.

That is the main reason for fast compilation. And this is by design.

Answered By – Igor Krivokon

Answer Checked By – David Goodson (GoLangFix Volunteer)

Leave a Reply

Your email address will not be published.