-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
runtime/pprof: collecting mutex or block profiles add ~100ms of wall time #63078
Comments
@rhysh Any chance you're interested in working on this? :) I added the "help wanted" tag for now since I don't think we'll get around to it for the next release. |
I'm not sure what the right product choice is on how little (or absent) the delay can/should be. Today, it's usually much faster than this because of async preemption / #63103. At the moment I'm happy to have an open issue that describes where the profilers are in need of improvement, instead of having to find the skeletons one by one and then describing them by word of mouth. Thanks for adding the label; I won't be able to get to this for Go 1.22 either. |
I'm happy to pick this up as a starter task, what's the expected behaviour? |
Change https://go.dev/cl/538898 mentions this issue: |
@thepenguinco Thanks for offering! Sorry for not replying. It turns out to be on the critical path (ish) for something I was already working on, so I tried to improve the situation a bit. I think the goals is just to reduce the amount of wall time added. |
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: