Issue 14900: cProfile does not take its result headers as sort arguments (original) (raw)

Issue14900

Created on 2012-05-24 14:19 by ArneBab, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
2.7-0-pcalls.diff ArneBab,2012-05-24 14:19 2.7-0-pcalls.diff review
2.7-1-headings-sortable.diff ArneBab,2012-05-24 14:19 2.7-1-headings-sortable.diff
3.2-0-pcalls.diff ArneBab,2012-05-24 14:19 3.2-0-pcalls.diff review
3.2-1-headings-sortable.diff ArneBab,2012-05-24 14:20 3.2-1-headings-sortable.diff
profile-docs-3.2.diff ArneBab,2012-10-08 08:44 patch for updating the docs
profile-docs-2.7.diff ArneBab,2012-10-08 08:45 patch for updating the docs review
sort-argument-3.2.diff ArneBab,2012-10-08 14:47
sort-argument-2.7.diff ArneBab,2012-10-08 14:50
Messages (20)
msg161508 - (view) Author: Arne Babenhauserheide (ArneBab) * Date: 2012-05-24 14:19
cProfile reports the profiling result in a table with the headers ncalls tottime percall cumtime percall filename:lineno(function) The respective arguments are calls time - cumulative - nfl Since I had to lookup these different names everytime I used cProfile, I think that it should take the table headings as argument aliases. Also there is inconsistent naming of pcalls between docs and code. In the docs of Stats.sort_stats pcalls is named primitive call count. In the code at Stats.sort_arg_dict_default it was just named call count. I created 4 patches to fix that in Python 2.7 and Python 3.2. The first is attached here, the later will be attached to comments. They apply to 822d7a1f8885 for 2.7 and 89b699e68fa2 for 3.2. I also created a patch for adding percall sorting, but that requires more invasive changes and I did not see a simple name to distinguish between the two bycall headings.
msg169983 - (view) Author: Arne Babenhauserheide (ArneBab) * Date: 2012-09-07 10:40
What would be the best way to get this patch reviewed?
msg169984 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2012-09-07 10:47
I'll take a look next week if nobody else do it before.
msg170018 - (view) Author: Arne Babenhauserheide (ArneBab) * Date: 2012-09-07 23:17
Thank you!
msg170879 - (view) Author: Arne Babenhauserheide (ArneBab) * Date: 2012-09-21 11:02
Did you get to taking a look? Is there anything I should change?
msg172311 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-10-07 15:59
New changeset cc3e27b7da41 by Andrew Svetlov in branch '2.7': Issue #14900: Distuguish call count and primitive call count in pstat output. http://hg.python.org/cpython/rev/cc3e27b7da41 New changeset 410e92589164 by Andrew Svetlov in branch '3.2': Issue #14900: Distuguish call count and primitive call count in pstat output. http://hg.python.org/cpython/rev/410e92589164 New changeset fb216fee32db by Andrew Svetlov in branch '3.3': Merge issue #14900: Distuguish call count and primitive call count in pstat output. http://hg.python.org/cpython/rev/fb216fee32db New changeset bc658b6a1d4e by Andrew Svetlov in branch 'default': Issue #14900: Distuguish call count and primitive call count in pstat output. http://hg.python.org/cpython/rev/bc658b6a1d4e
msg172312 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2012-10-07 16:02
I definitely agree with renaming "call count" to "primitive call count". Thank you for patch. BTW please fill Python Contributor Agreement: http://www.python.org/psf/contrib/
msg172315 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-10-07 16:23
New changeset 69b310f7acfa by Andrew Svetlov in branch '2.7': Issue #14900: Add aliases for sorting params for pstat to follow column names from pstat output. http://hg.python.org/cpython/rev/69b310f7acfa New changeset 511a3c51731e by Andrew Svetlov in branch '3.2': Issue #14900: Add aliases for sorting params for pstat to follow column names from pstat output. http://hg.python.org/cpython/rev/511a3c51731e New changeset 29d4ac311627 by Andrew Svetlov in branch '3.3': Merge issue #14900: Add aliases for sorting params for pstat to follow column names from pstat output. http://hg.python.org/cpython/rev/29d4ac311627 New changeset 7b8b1b30e5f8 by Andrew Svetlov in branch 'default': Merge issue #14900: Add aliases for sorting params for pstat to follow column names from pstat output. http://hg.python.org/cpython/rev/7b8b1b30e5f8
msg172317 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2012-10-07 16:24
I'm ok with aliases also. Issue with percall can be fixed only in 3.4 via renaming one of the column. Thanks again.
msg172318 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2012-10-07 16:28
Documentation also need to be updated to reflect changes.
msg172347 - (view) Author: Arne Babenhauserheide (ArneBab) * Date: 2012-10-07 21:37
Copyright-assignment signed and sent. Thanks!
msg172371 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2012-10-08 10:51
Looks like you missed *sort* parameter for ".. function:: run(command, filename=None, sort=-1)" Also it will be nice to insert link to Stats.sort_stats in doc text for run functions.
msg172382 - (view) Author: Arne Babenhauserheide (ArneBab) * Date: 2012-10-08 14:42
Jepp, I missed that. I hope the added patches clear that up.
msg172385 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2012-10-08 15:20
Sorry, I cannot figure out what hg repo version should I use to apply sort-argument* patches. Can you prepare 2 cumulative patches for 2.7 and 3.2 which can be applied to current repo state? It's CPython team policy to send patches which can be applied to pure repo if no other rule explicitly specified. Thanks.
msg172412 - (view) Author: Arne Babenhauserheide (ArneBab) * Date: 2012-10-08 20:40
I’ll create them as soon as I get the time. It’s not as if that’s really hard - but I still have to do it (need to diff against current tip - I already merged, so that should work without problems).
msg173207 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2012-10-17 21:21
I'm waiting for your patch. Thanks.
msg174362 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-10-31 20:06
New changeset f263a84871de by Andrew Svetlov in branch '2.7': Issue #14900: document added sort keys for profile stats. http://hg.python.org/cpython/rev/f263a84871de New changeset 52d6974fa05b by Andrew Svetlov in branch '3.2': Issue #14900: document added sort keys for profile stats. http://hg.python.org/cpython/rev/52d6974fa05b New changeset 78963f00d4ad by Andrew Svetlov in branch '3.3': Merge issue #14900: document added sort keys for profile stats. http://hg.python.org/cpython/rev/78963f00d4ad New changeset dd4783955353 by Andrew Svetlov in branch 'default': Issue #14900: document added sort keys for profile stats. http://hg.python.org/cpython/rev/dd4783955353
msg174363 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2012-10-31 20:08
Fixed. For future improvements please open new issue. Thanks.
msg174431 - (view) Author: Arne Babenhauserheide (ArneBab) * Date: 2012-11-01 16:42
…you were faster than me (I only managed to get the repo onto my current computer yesterday and the children kept me occupied). Thank you!
msg174432 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2012-11-01 16:51
No problems!
History
Date User Action Args
2022-04-11 14:57:30 admin set github: 59105
2012-11-01 16:51:45 asvetlov set messages: +
2012-11-01 16:42:20 ArneBab set messages: +
2012-10-31 20:08:54 asvetlov set status: open -> closedcomponents: + Documentationversions: + Python 3.3, Python 3.4messages: + type: enhancementresolution: fixedstage: resolved
2012-10-31 20:06:54 python-dev set messages: +
2012-10-17 21:21:57 asvetlov set messages: +
2012-10-08 20:40:28 ArneBab set messages: +
2012-10-08 15:20:20 asvetlov set messages: +
2012-10-08 14:50:49 ArneBab set files: + sort-argument-2.7.diff
2012-10-08 14:50:40 ArneBab set files: - sort-argument-2.7.diff
2012-10-08 14:47:47 ArneBab set files: + sort-argument-3.2.diff
2012-10-08 14:42:58 ArneBab set files: - sort-argument-3.2.diff
2012-10-08 14:42:39 ArneBab set messages: +
2012-10-08 14:37:53 ArneBab set files: + sort-argument-3.2.diff
2012-10-08 14:37:22 ArneBab set files: + sort-argument-2.7.diff
2012-10-08 10:51:27 asvetlov set messages: +
2012-10-08 08:45:07 ArneBab set files: + profile-docs-2.7.diff
2012-10-08 08:44:50 ArneBab set files: + profile-docs-3.2.diff
2012-10-07 21:37:06 ArneBab set messages: +
2012-10-07 16:28:29 asvetlov set messages: +
2012-10-07 16:24:50 asvetlov set messages: +
2012-10-07 16:23:03 python-dev set messages: +
2012-10-07 16:02:38 asvetlov set assignee: asvetlovmessages: +
2012-10-07 15:59:39 python-dev set nosy: + python-devmessages: +
2012-09-21 11:02:36 ArneBab set messages: +
2012-09-07 23:17:31 ArneBab set messages: +
2012-09-07 10:47:11 asvetlov set messages: +
2012-09-07 10:40:08 ArneBab set messages: +
2012-07-22 08:08:02 asvetlov set nosy: + asvetlov
2012-05-24 14:20:09 ArneBab set files: + 3.2-1-headings-sortable.diff
2012-05-24 14:19:53 ArneBab set files: + 3.2-0-pcalls.diff
2012-05-24 14:19:40 ArneBab set files: + 2.7-1-headings-sortable.diff
2012-05-24 14:19:23 ArneBab create