-
Notifications
You must be signed in to change notification settings - Fork 258
kernprof.py -m package #3
Comments
I think this would be really useful to have, but of course it's not entirely trivial. My main question would be how to handle profiling imports within the module. Should each imported module be profiled as well--or should a module only be profiled if it's also been tagged for profiling (a la LineProfiler.add_function, but for a module)? |
My optimal command-line experience would be something like
Then there's no need to edit the file for profiling, you can just save a tiny script for that. |
I interpret the request as simply enabling |
Ah, I interpreted this maybe as something more like #26, that is, profiling module-level code that is not in a function. I have some ideas for making that work if you'd be interested in a patch. |
(I was also initially talking about @rkern's interpretation -- my next comment is further down on my wishlist.) |
Hi, all. I still confused about this situation. I have the main function a in file a.py, and it another function b in b.py. So I add the @Profile to b function. But when I run the kernprof -l -v a.py. There is not the detail of b function. Is the same problem with this issue? Is it solved? |
@Lan1991Xu This issue is unrelated to your problem. Please open a new issue with more information. Please create a complete, minimal example that we can run that demonstrates the problem. Thanks. |
OK,thanks for your reply |
Really like line_profiler - it's helped me immensely. However, if i also want other windows to run the same code, but not under profile, I have to put in a fake profile decorator that everything else uses. A very helpful workflow would be to pass the profiling functions on the command line so they can be wrapped then before being run - but leave the pure code alone so that other timing and unit testing scripts can continue to work. |
Support for running
package.__main__
viakernprof.py -m package
would be appreciated, thanks.The text was updated successfully, but these errors were encountered: