This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author wdv4758h
Recipients wdv4758h
Date 2015-12-05.08:25:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1449303952.27.0.310214243782.issue25804@psf.upfronthosting.co.za>
In-reply-to
Content
Currently, the result of profile.run can not easily sort by mutiple values with "sort" keyword argument. Following code will work with this patch.

>>> import cProfile
>>> cProfile.run('42**42', sort=('tottime', 'stdname'))
         3 function calls in 0.000 seconds

   Ordered by: internal time, standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.000    0.000    0.000    0.000 {built-in method builtins.exec}
        1    0.000    0.000    0.000    0.000 <string>:1(<module>)
        1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}

>>> import cProfile
>>> cProfile.run('42**42', sort=('tottime', 'stdname'))
         3 function calls in 0.000 seconds

   Ordered by: internal time, standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.000    0.000    0.000    0.000 {built-in method builtins.exec}
        1    0.000    0.000    0.000    0.000 <string>:1(<module>)
        1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}


>>> import profile
>>> profile.run('42**42', sort=('tottime', 'stdname'))
         4 function calls in 0.000 seconds

   Ordered by: internal time, standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.000    0.000    0.000    0.000 profile:0(42**42)
        1    0.000    0.000    0.000    0.000 :0(exec)
        1    0.000    0.000    0.000    0.000 :0(setprofile)
        1    0.000    0.000    0.000    0.000 <string>:1(<module>)
        0    0.000             0.000          profile:0(profiler)
History
Date User Action Args
2015-12-05 08:25:52wdv4758hsetrecipients: + wdv4758h
2015-12-05 08:25:52wdv4758hsetmessageid: <1449303952.27.0.310214243782.issue25804@psf.upfronthosting.co.za>
2015-12-05 08:25:52wdv4758hlinkissue25804 messages
2015-12-05 08:25:51wdv4758hcreate