-
-
Save planetceres/28cc663948bcd11f3f502aadf5c02893 to your computer and use it in GitHub Desktop.
Profiling a Python module
This file contains hidden or 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
import cProfile | |
import pstats | |
import my_slow_module | |
cProfile.run('my_slow_module.run()', 'restats') | |
p = pstats.Stats('restats') | |
p.sort_stats('cumulative').print_stats(30) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment