latex2e writer : Move usepackage hyperref after stylesheet inclusion.
[docutils.git] / tools / dev / profile_docutils.py
blobe342b02395b2fc54e0e3e713c9152d712f9ae4ca
1 #!/usr/bin/python -i
3 # $Id$
4 # Author: Lea Wiemann <LeWiemann@gmail.com>
5 # Copyright: This script has been placed in the public domain.
7 import os.path
8 import docutils.core
9 import hotshot.stats
11 print 'Profiler started.'
13 os.chdir(os.path.join(os.path.dirname(docutils.__file__), '..'))
15 print 'Profiling...'
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')
20 prof.close()
22 print 'Loading statistics...'
24 print """
25 stats = hotshot.stats.load('docutils.prof')
26 stats.strip_dirs()
27 stats.sort_stats('time') # 'cumulative'; 'calls'
28 stats.print_stats(40)
29 """
31 stats = hotshot.stats.load('docutils.prof')
32 stats.strip_dirs()
33 stats.sort_stats('time')
34 stats.print_stats(40)
36 try:
37 execfile(os.environ['PYTHONSTARTUP'])
38 except:
39 pass