pkg / profile

Simple profiling for Go
BSD 2-Clause "Simplified" License
1.99k stars 124 forks source link

No support to run multiple profile #62

Closed prakashettigar closed 3 years ago

prakashettigar commented 3 years ago
profile.Start(profile.MemProfile, profile.ProfilePath("."), profile.NoShutdownHook)
profile.Start(profile.CPUProfile, profile.ProfilePath("."), profile.NoShutdownHook)

Starting multiple profiles throws an error : profile: Start() already called

davecheney commented 3 years ago

This is a deliberate design choice.

10sor commented 2 years ago

@davecheney can you please explain why?

davecheney commented 2 years ago

Running multiple profiles at the same time causes interference.

yonderblue commented 1 year ago

@davecheney is the interference something that breaks or just skew results? For example with mem+cpu the coarse relative picture seems to hold up well in cases I've checked despite the overhead.

davecheney commented 1 year ago

It skews the results.

LiranBri commented 10 months ago

I suggest to add the explanation to the actual error, as it's not trivial as in fact it makes the pkg do more than just a convenient proxy to the native API, because the native API does allow running multiple profilers.

If you agree I can make the PR