runtime/pprof: collecting mutex or block profiles add ~100ms of wall time #63078
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
help wanted
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, Go 1.21 is the latest release series.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
Somewhat small overhead for using block and mutex profiles in otherwise lightweight tools. Small impact to app startup (which may include the call to
runtime.SetBlockProfileRate
).What did you see instead?
The first call to
runtime.tickspersecond
callsusleep(100 * 1000)
, which (if uninterrupted) takes 100ms. There's one such call inruntime.SetBlockProfileRate
https://github.com/golang/go/blob/go1.21.1/src/runtime/mprof.go#L471 when configuring the block profiler, even if that profile is never read. There are others in the code to write out mutex and block profiles.The text was updated successfully, but these errors were encountered: