Closed inducer closed 3 years ago
vmprofshow
is documented in the README.md
page. Could you update that with an example of using the new options?
vmprofshow
is documented in theREADME.md
page. Could you update that with an example of using the new options?
9789b49. See https://github.com/inducer/vmprof-python/tree/add-vmprof-show-flat for a rendered view.
I should note that this changes the interface of vmprofshow
a bit, as described in the updated documentation, because of the use of subparsers for the different modes. I think that makes sense, because it prevents ineffective options from being provided. One downside is that the user must now specify a mode. (I.e. specifying tree
or one of the other modes is now mandatory.)
Thanks for taking a look! All your suggestions LGTM.
Thanks @inducer
While the default display of vmprof is very successful at finding where code spends its time viewed from the root of the call tree, it does not work well to find the worst offenders when viewed from the leaves, i.e. functions that spend a lot of time in aggregate, by being called very often. This PR refactors
vmprofshow
to useArgumentParser
subparsers for its command line interface, and makes the existinglines
mode use that. It also adds aflat
mode that presentsflat
statistics of time used, a bit more likepstats
fromcProfile
. Here's some example output:A legitimate question would be, why add that when
cProfile
already has that. I'll simply add the (analogous) cProfile output fo the same code:Note that the two sets of output are nothing alike... and at least for now I'm inclined to trust vmprof more. :)
At any rate, thanks for vmprof, and maybe you'll find this useful.
cc @matthiasdiener