问题
package main
import "fmt"
func main() {
fmt.Println("Hello world")
}
The command is go run a.go
.
This code need 4~5s in windows.
回答1:
I believe that go run
compiles the code and then runs it. Go 1.5 is known to be much slower at compiling. (Read the release notes) The devs have converted it all to Go code but haven't optimized it for Go yet.
Also Go uses POSIX style disk and network operations. I don't believe anyone has optimized Go for completion ports and Windows asynch IO.
来源:https://stackoverflow.com/questions/32062493/golang-is-slow-in-windows