Skip to content
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

Question: what are the time units? #311

Closed
jurc192 opened this issue Sep 24, 2020 · 3 comments
Closed

Question: what are the time units? #311

jurc192 opened this issue Sep 24, 2020 · 3 comments

Comments

@jurc192
Copy link

jurc192 commented Sep 24, 2020

I profiled a python program with py-spy and am visualizing the results on www.speedscope.app.
What are the units of time, displayed at the timeline? (time order view)
What about the bottom right box w/ "This instance" and "All instances"? What is the meaning of those numbers?
Thanks for help :)

@bjorn3
Copy link

bjorn3 commented Sep 24, 2020

py-spy uses samples as unit: https://github.com/benfred/py-spy/blob/0a409aa57f28fccfb0d94a8d2a16b2ed0d6c42d3/src/speedscope.rs#L143 py-spy is a sampling profiler, which means that it samples the current stack every so often. The default sample rate is 100Hz: https://github.com/benfred/py-spy/blob/fedd53bd799efdac33d5a41ad56b1bb8047684b4/src/config.rs#L83 It is possible for samples to be taken later than that though.

@jurc192 jurc192 closed this as completed Sep 24, 2020
@jlfwong
Copy link
Owner

jlfwong commented Sep 24, 2020

FWIW, speedscope's file format supports specifying the time unit:

// Unit which all value are specified using in the profile.
unit: ValueUnit

So py-spy could specify this by taking into account the sampling rate and make it easier to read in the resulting profiles

@benfred
Copy link

benfred commented Sep 25, 2020

thanks for the suggestion @jlfwong - I've created an issue in py-spy to track adding ValueUnit to py-spy profiles benfred/py-spy#294

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants