Skip to content

How do I limit the depth of Scalene profiling? #292

Discussion options

You must be logged in to vote

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!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by DerAndereJohannes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant