英文:
How can I track down what is causing `go build` to take a long time?
问题
运行带有-v选项并不能真正告诉我问题出在哪里。甚至在打印出一行内容之前,需要大约20秒的时间。
在strace
下运行会输出很多噪音,而且strace
在Mac OS上无法运行。
删除依赖项以查看它们是否是问题将需要大量的工作量。
英文:
Running it with -v does not really tell me what the problem is. It takes about 20s before printing even a single line.
Running it under strace
outputs a lot of noise, and strace
does not run on Mac OS.
Removing dependencies to see if they are the problem would be a ridiculous amount of work.
答案1
得分: 5
你可以使用-x
标志来显示正在执行的所有命令:
https://godocs.io/cmd/go#hdr-Compile_packages_and_dependencies
英文:
You can use the -x
flag to show all commands being executed:
https://godocs.io/cmd/go#hdr-Compile_packages_and_dependencies
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论