Add initial performance profiling support.

This commit is contained in:
Andrew Ferrier 2015-11-02 22:10:15 +00:00
parent 6604f6938d
commit 88923c7bf7
3 changed files with 12 additions and 0 deletions

2
.gitignore vendored
View file

@ -55,3 +55,5 @@ docs/_build/
# PyBuilder
target/
.email2pdf.profile

View file

@ -59,4 +59,10 @@ coverage:
nosetests tests/Direct/*.py --with-coverage --cover-package=email2pdf,tests --cover-erase --cover-html --cover-branches
open cover/index.html
.email2pdf.profile: email2pdf
python3 -m cProfile -o .email2pdf.profile `which nosetests` .
profile: .email2pdf.profile
python3 performance/printstats.py | less
alltests: unittest analysis coverage

View file

@ -0,0 +1,4 @@
import pstats
p = pstats.Stats('.email2pdf.profile')
p.strip_dirs().sort_stats('time').print_callers(30)