1. 首页
  2. 主题
  3. Go问与答

为啥编译一个Hello World要12秒?

mathieu · · 2077 次点击
在sublime text 3和直接在命令行都试过了,编译运行Hello World都很慢,问题在哪呢? ![build.png](https://static.studygolang.com/190622/018bf488ae611a01cbb902ec9d2afee4.png) ![cmd.png](https://static.studygolang.com/190622/0394c2ea8969eae2e8a4edeadb4f99c7.png)
hello world基本在三秒左右,开发web项目编译和启动比java快多了,看go env信息你用的是32位版本,如果你是64位的处理器建议换64位版本,编译和启动速度和电脑的配置也有一定的关系
#4
更多评论
``` bash lurenjia@lurenjia:~/桌面$ date ; go build hw.go ; date 2019年 06月 23日 星期日 10:36:09 CST 2019年 06月 23日 星期日 10:36:09 CST lurenjia@lurenjia:~/桌面$ date ; ./hw ; date 2019年 06月 23日 星期日 10:36:22 CST hello world 2019年 06月 23日 星期日 10:36:22 CST lurenjia@lurenjia:~/桌面$ cat hw.go package main import "fmt" func main() { fmt.Println("hello world") } ``` ``` bash lurenjia@lurenjia:~/桌面$ date ; go run hw.go ; date 2019年 06月 23日 星期日 10:37:05 CST hello world 2019年 06月 23日 星期日 10:37:05 CST ```
#1
一个是windows系统,一个是linux系统。不一样吧。我也是win系统的,运行好慢。我以为是什么问题。
#2

用户登录

没有账号?注册

今日阅读排行

    加载中

一周阅读排行

    加载中