Created
June 4, 2018 08:31
-
-
Save thomwolf/47520f51380e8a57f078f44bf79c8e53 to your computer and use it in GitHub Desktop.
Profiling a Python module
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
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