FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-34861: better cProfile CLI defaults: sort by time, restrict to top 20 by andreasvc · Pull Request #13083 · python/cpython · GitHub

/ cpython Public

bpo-34861: better cProfile CLI defaults: sort by time, restrict to top 20 - #13083

Closed
andreasvc wants to merge 3 commits into
python:mainfrom
andreasvc:cprofile-sortdefault
Closed

bpo-34861: better cProfile CLI defaults: sort by time, restrict to top 20#13083
andreasvc wants to merge 3 commits into
python:mainfrom
andreasvc:cprofile-sortdefault

Conversation

andreasvc commented May 4, 2019
edited
Loading

Copy link
Copy Markdown

adds option -n to restrict to top n lines (defaults to 20 for CLI)
set default of -s to sort by time (instead of unsorted)
makes "python3 -m cProfile foo.py" directly usable.

https://bugs.python.org/issue34861

adds option -n to restrict to top n lines (defaults to 20 for CLI)
set default of -s to sort by time (instead of unsorted)
"python3 -m cProfile foo.py" directly usable.

Copy link
Copy Markdown

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for your contribution, we look forward to reviewing it!

andreasvc changed the title BPO-34861: better cProfile CLI defaults: sort by time, restrict to top 20 bpo-34861: better cProfile CLI defaults: sort by time, restrict to top 20 May 4, 2019

mangrisano left a comment
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Hi, thank you for the pull request and for the patience. I've left a couple of comments about the changes.
Just a question: did yo test it? If didn't, please provide it. Thank you.
Furthermore, the Doc and perhaps the docstring should be improved adding the parameter and explaining what it does.

I'm not a core-dev, so feel free to don't follow my tips.

Comment thread Lib/cProfile.py

def runctx(statement, globals, locals, filename=None, sort=-1):
def runctx(statement, globals, locals, filename=None, sort=-1,
numresults=None):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please, indent numresults under statement.

Comment thread Lib/cProfile.py
}
runctx(code, globs, None, options.outfile, options.sort)
runctx(code, globs, None, options.outfile, options.sort,
options.numresults)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please, indent options.numresults under code.

Comment thread Lib/profile.py

def runctx(statement, globals, locals, filename=None, sort=-1):
def runctx(statement, globals, locals, filename=None, sort=-1,
numresults=None):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The same for this row. :)

Comment thread Lib/profile.py
}
runctx(code, globs, None, options.outfile, options.sort)
runctx(code, globs, None, options.outfile, options.sort,
options.numresults)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Indent options.numresults under code.

hauntsaninja left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Note that #31929 made the default sort order cumtime. Any interest in merging main and picking this back up?

hauntsaninja left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Requesting changes as per above

Copy link
Copy Markdown

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Copy link
Copy Markdown
Author

@hauntsaninja personally I like time more than cumtime, but if it has been decided that cumtime should be the default, fine. Don't know if I have time to pick this up in the short term, so if anyone else wants to pick it up, by all means!

python-cla-bot Bot commented Apr 6, 2025

Copy link
Copy Markdown

The following commit authors need to sign the Contributor License Agreement:

github-actions Bot commented Jan 1, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

github-actions Bot added the stale Stale PR or inactive for long period of time. label Jan 1, 2026

Copy link
Copy Markdown
Member

Hello! I'm sorry but I'm closing this PR as it is stale, has requested changes, and has not signed the CLA.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting changes stale Stale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants


Back | FazBrowse Home | New Git URL