Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved a code snippet from profiling_tutorial.rst to the examples dire…
…ctory.
- Loading branch information
gabrieldemarmiesse
committed
Jun 16, 2018
1 parent
3d291a5
commit d39d579
Showing
2 changed files
with
15 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# profile.py | ||
|
||
import pstats, cProfile | ||
|
||
import pyximport | ||
pyximport.install() | ||
|
||
import calc_pi | ||
|
||
cProfile.runctx("calc_pi.approx_pi()", globals(), locals(), "Profile.prof") | ||
|
||
s = pstats.Stats("Profile.prof") | ||
s.strip_dirs().sort_stats("time").print_stats() |
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