When testing go’s integration test coverage system (Coverage profiling support for integration tests - The Go Programming Language), I noticed that the runtime/coverage APIs exposed for non-test main exit scenarios required “atomic” mode.
One of the comments in the package
https://cs.opensource.google/go/go/+/refs/tags/go1.24.5:src/runtime/coverage/coverage.go;l=64 hints at a deeper explanation but i’m not able to find it in the file.
I understand that set mode is cheap but if the “runtime/coverage” APIs can’t be used outside of atomic mode it seems that atomic mode should be on by default? Is there analysis from the Go team that sheds light on how much more expensive atomic mode is?