How to profile / benchmark / time a chunk of code #568
DominiqueMakowski
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Total time of a function
Benchmark the calls
The function call is entered as a string.
Benchmark the calls within a function with snakeviz
I put it here because I always forget how to do it and spend some time re-re-regoogling it:
pip install snakeviz
(https://jiffyclub.github.io/snakeviz/)Run this:
(note that in interactive jupyer in vs-code you need to manually select the last line, just putting the cursor on it and hitting shift+enter doens't work)
Beta Was this translation helpful? Give feedback.
All reactions