Closed durden closed 8 years ago
It might also be worth mentioning in the docs that this doesn't support the script being profiled from having duplicate arguments to vprof
. Not sure what the best workaround is there. I looked around to see what cProfile
did, but I didn't find anything useful.
Hi,
vprof
supports profiling scripts with their own arguments, you just need to use double quotes:
vprof -c cmh -s "testscript.py --foo --bar"
.
sys.args
manipulation is done here: https://github.com/nvdv/vprof/blob/master/vprof/base_profile.py#L72
Oh ok, thanks for the clarification. I guess my change doesn't require double quotes, but double quotes is easy to add so no worries. I clearly see how this is specified in the README now, sorry I missed it!
Sure 😄
Since the issue is resolved, I am closing this PR. Thanks!
This is a trick similar to what the default cProfile module does to allow profiling of scripts that have their own arguments.