Last active
May 21, 2016 20:43
-
-
Save re9ulus/95d390c71a13ba83393fb3a98dd8d6ae to your computer and use it in GitHub Desktop.
Python profiler example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cProfile | |
import cProfile | |
source = open('path/to/src').read() | |
cProfile.run(source, sort='tottime) | |
# Line profiler (using IPython) | |
%load_ext line_profiler | |
from mypackage import foo, bar | |
%lprun -f bar foo() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment