How do I limit the depth of Scalene profiling? #292
-
Setting the Scene What I am trying to do What I have Tried What I am asking Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
ah. Figured it out. To anyone who might be having the same question, here is the answer I came up with: If anyone has a more suitable solution to this question, please let me know! |
Beta Was this translation helpful? Give feedback.
ah. Figured it out. To anyone who might be having the same question, here is the answer I came up with:
By using the --program-path flag, I set the scope of the profiler to be only in the folder containing my code (the flag also includes all sub-directories of the folder recursively). To remove import times from functions outside of my scope, I added all the imports in the script.py file before I started the profiler using scalene_profiler.start(). In the end my command was: "scalene --off --reduced-profile --program-path /path/to/my/repo script.py"
If anyone has a more suitable solution to this question, please let me know!