4 # Author: Lea Wiemann <LeWiemann@gmail.com>
5 # Copyright: This script has been placed in the public domain.
11 print 'Profiler started.'
13 os
.chdir(os
.path
.join(os
.path
.dirname(docutils
.__file
__), '..'))
17 prof
= hotshot
.Profile('docutils.prof')
18 prof
.runcall(docutils
.core
.publish_file
, source_path
='HISTORY.txt',
19 destination_path
='prof.HISTORY.html', writer_name
='html')
22 print 'Loading statistics...'
25 stats = hotshot.stats.load('docutils.prof')
27 stats.sort_stats('time') # 'cumulative'; 'calls'
31 stats
= hotshot
.stats
.load('docutils.prof')
33 stats
.sort_stats('time')
37 exec(open(os
.environ
['PYTHONSTARTUP']).read())