Skip to content

bpo-32017: Document differences between profile.Profile and cProfile.Profile#5887

Closed
bbayles wants to merge 4 commits intopython:masterfrom
bbayles:profile-docs-32017
Closed

bpo-32017: Document differences between profile.Profile and cProfile.Profile#5887
bbayles wants to merge 4 commits intopython:masterfrom
bbayles:profile-docs-32017

Conversation

@bbayles
Copy link
Copy Markdown
Contributor

@bbayles bbayles commented Feb 25, 2018

This PR updates the profile module's documentation to reflect some significant differences between profile.Profile and cProfile.Profile.

For example, the current docs imply that the Python version has enable() and disable() methods - it doesn't. The two versions also have different __init__ parameters (which are describe elsewhere in the document).

In this version there is a section for each class, with the proper list of supported methods. I've also noted where the different classes have different behavior for the same method - cProfile.Profile's print_stats() method needs to be initialized, for example.


For convenience, the rendered docs look like this:

Motivating example

intro-image

profile.Profile

python-image

cProfile.Profile

c-image


These changes could apply to Python 3.7 as well. Versions before that are also deficient, but need some more tweaking due to the addition of the SortKey enum.

https://bugs.python.org/issue32017

@bbayles
Copy link
Copy Markdown
Contributor Author

bbayles commented Jul 13, 2018

I've resolved conflicts on this, in case anybody is watching.

@bbayles bbayles closed this Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants