Golang在Windows上运行速度较慢。

huangapple go评论85阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2015年8月18日 10:13:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/32062493.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定