英文:
golang is slow in Windows
问题
package main
import "fmt"
func main() {
fmt.Println("Hello world")
}
命令是 go run a.go
。
这段代码在Windows上需要4~5秒。
英文:
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
得分: 5
我相信go run
会编译代码然后运行它。众所周知,Go 1.5在编译方面速度较慢。(请阅读发布说明)开发人员已将所有内容转换为Go代码,但尚未针对Go进行优化。
此外,Go使用POSIX风格的磁盘和网络操作。我不认为有人已经针对完成端口和Windows异步IO对Go进行了优化。
英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论