[issue18795] pstats - allow stats sorting by cumulative time per call and total time per call

2013-08-20 Thread Alexandre Dias

New submission from Alexandre Dias:

Me and a couple of colleagues have stumbled upon the need to sometimes sort our 
profiling stats by time (cumulative and total) per call. I believe this could 
be useful to other people, and have therefore opened this patch.

Thanks for taking the time to look into it.

-Alexandre

--
components: Library (Lib)
files: pstats.py
messages: 195731
nosy: alexnvdias
priority: normal
severity: normal
status: open
title: pstats - allow stats sorting by cumulative time per call and total time 
per call
type: enhancement
versions: Python 2.7
Added file: http://bugs.python.org/file31391/pstats.py

___
Python tracker 
<http://bugs.python.org/issue18795>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18795] pstats - allow stats sorting by cumulative time per call and total time per call

2013-08-21 Thread Alexandre Dias

Alexandre Dias added the comment:

It does support sorting by total time and cumulative time spent on a function, 
but not by the time per each call of that function.

I've uploaded a diff of the patch.

-Alexandre

--
versions: +Python 3.4 -Python 2.7
Added file: http://bugs.python.org/file31396/pstats-diff-issue18795.txt

___
Python tracker 
<http://bugs.python.org/issue18795>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18795] pstats - allow stats sorting by cumulative time per call and total time per call

2013-08-21 Thread Alexandre Dias

Alexandre Dias added the comment:

Average time would indeed be a better description. 

As for its usefulness: let's say that for example you would want to find the 
function in which your code spends the most time on average, in order to later 
optimise said function. If one of the calls to another function has its 
execution time spike momentarily, it will be at the top of the total time 
column on the result. However, that does not necessarily mean that it was the 
function in which on average the most time was spent on, and thus the one that 
the optimisation effort should be focused on.
Also, when seeing the profiling results, I would expect to be able to sort by 
any of the columns shown, and that is currently not possible for the average 
cumulative and total time per call.

Do you mind clarifying your worries with backwards compatibility? Unless I'm 
mistaken, "fcn_list "is the only outside effect of the method I'm changing. It 
is built from the last element of each tuple in stats_list, whose ordering is 
what I'm proposing to be able to change (thus changing the ordering of the 
function list, but that is already done by other sort options).

--

___
Python tracker 
<http://bugs.python.org/issue18795>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18795] pstats - allow stats sorting by cumulative time per call and total time per call

2014-01-28 Thread Alexandre Dias

Alexandre Dias added the comment:

Could I get an update on this please?

--

___
Python tracker 
<http://bugs.python.org/issue18795>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com