Open BarrensZeppelin opened 6 months ago
Could you add a test for this, and add it to the documentation?
Like this? :slightly_smiling_face:
Yes, thanks. I assume you have run this and it successfully calls the module as expected?
Yeah. http.server
is a bad example for performance profiling, but it seems to work:
$ python3 -m vmprof --output file.prof -m http.server
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
127.0.0.1 - - [07/Mar/2024 17:56:57] "GET / HTTP/1.1" 200 -
^C
Keyboard interrupt received, exiting.
$ vmprofshow file.prof flat
100.000% - <unknown code>:None:None
0.000% - <module>:/opt/pypy3/lib/pypy3.10/http/server.py:1
0.000% - __import__:<frozen importlib._bootstrap>:1117
0.000% - _gcd_import:<frozen importlib._bootstrap>:1038
0.000% - _find_and_load:<frozen importlib._bootstrap>:1022
0.000% - _find_and_load_unlocked:<frozen importlib._bootstrap>:987
0.000% - _load_unlocked:<frozen importlib._bootstrap>:664
0.000% - exec_module:<builtin>/frozen importlib._bootstrap_external:891
0.000% - _call_with_frames_removed:<frozen importlib._bootstrap>:233
0.000% - <module>:/opt/pypy3/lib/pypy3.10/html/__init__.py:1
0.000% - get_code:<builtin>/frozen importlib._bootstrap_external:964
0.000% - source_to_code:<builtin>/frozen importlib._bootstrap_external:956
0.000% - _code_to_timestamp_pyc:<builtin>/frozen importlib._bootstrap_external:697
It makes vmprof run the specified program with
runpy.run_module
instead ofrunpy.run_path
.