Why is Go compilation so fast? Secrets of build speed
Hi everyone! I recently started learning Go and noticed one thing that amazed me — compilation speed. In my Python project, I was used to waiting a few seconds for a test to start, but here even a large project compiles in fractions of a second. I wrote a simple program for comparison:
```go
package main
import "fmt"
func main() {
fmt.Println("Hello, Go!")
}
```
Compilation via `go build` takes literally 0.2 seconds. I tried adding several imports and functions, but the speed barely changed. For comparison, in C++ with CMake even a simple hello world takes longer to build.
I'm interested in what makes this speed possible? Is it a feature of the language, compiler, or architecture? I've heard that Go doesn't use a preprocessor like C/C++ and that it has a simple model
No answers yet.
Log in to leave an answer