Go底层碎语

1

另一个特别有用的信息是处于“可运行”状态的 goroutines 的数量(选定时间为 13 个):如果这个数字随着时间的推移变得很大,这可能表明我们需要更多的 CPU 来处理负载。

跟踪器是调试并发问题(例如争用和逻辑竞争)的强大工具。但它并不能解决所有问题:它不是追踪哪段代码花费最多 CPU 时间或分配的最佳工具。更go tool pprof适合这些用例。

Go语言的自举

Note that cmd/dist and (I think) some parts of cmd/compile and cmd/link need to remain buildable with Go 1.4 for bootstraping. Thus, these cannot use features newer than Go 1.4. Also see src/cmd/dist/README.

However, #44505 proposes to adopt Go 1.16 as the bootstrap toolchain for Go 1.18. That proposal was accepted, so we’ll probably be able to replace io/ioutil there as well for Go 1.18.

https://github.com/golang/go/issues/45557