-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Docs: Polish profile documentation #110494
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
base: main
Are you sure you want to change the base?
Conversation
Doc/library/profile.rst
Outdated
| @@ -141,6 +149,9 @@ the output by. This only applies when ``-o`` is not supplied. | |||
| .. versionadded:: 3.8 | |||
| Added the ``-m`` option to :mod:`profile`. | |||
|
|
|||
| Note that if the process is terminated by ``SIGTERM`` during profiling, no | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about SIGKILL? ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I changed the description a bit as there might be other cases when the profiling won't work.
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
|
@CAM-Gerlach could you maybe take a look at it? Thanks! |
|
@AA-Turner do you know who should I reach out to for the docs change? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your patience.
I'd prefer if we just removed clearly incorrect bits and added additional info, rather than reworking the "Limitations" section this extensively. Let me know what you think.
| One limitation has to do with accuracy of timing information. There is a | ||
| fundamental problem with deterministic profilers involving accuracy. The most | ||
| obvious restriction is that the underlying "clock" is only ticking at a rate | ||
| (typically) of about .001 seconds. Hence no measurements will be more accurate | ||
| than the underlying clock. If enough measurements are taken, then the "error" | ||
| will tend to average out. Unfortunately, removing this first error induces a | ||
| second source of error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I like this paragraph, and it still contains meaningful information. I'd just update it to leave out specifics about resolution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. But in reality, the clock resolution should not be an issue (or significant issue compared to other source) anymore. If we list this as limitation, there are a LOT of factors that we could potentially write here.
| this error. The error that accumulates in this fashion is typically less than | ||
| the accuracy of the clock (less than one clock tick), but it *can* accumulate | ||
| and become very significant. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd leave this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sentence the error that accumulates in this fashion is typically less than the accuracy of the clock (less than one clock tick) is incorrect now, as the accuracy of the clock has improved a lot for the last .. I don't know how many years. This is definitely more significant than the clock accuracy issue. Do you want me to keep the "become very significant"?
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
There are a couple of issues with the current (outdated) documentation
To profile a function that takes a single argumentis simply misleading. It does not have to be a function, anda single argumentis .. just wrong.sys.exit()is wrong - it can. However, cProfile/profile do not output results if profiling terminates because of SIGTERM #104676 mentioned that it can't handleSIGTERM. I moved this statement up - closer to where it should be seen.📚 Documentation preview 📚: https://cpython-previews--110494.org.readthedocs.build/