Skip to content

Instantly share code, notes, and snippets.

View adambarthelson's full-sized avatar
🐢

Adam Barthelson adambarthelson

🐢
  • Washington, D.C.
View GitHub Profile
@adambarthelson
adambarthelson / gist:5376300
Created April 13, 2013 00:47
Efficiency breakdown of Python files.
import os
import pstats
def testeff(path):
try:
os.remove('rep.prof')
except:
os.system('python -m cProfile -o rep.prof {}'.format(path))
p = pstats.Stats('rep.prof')
p.sort_stats('cumulative').print_stats(10)