diff --git a/doc/ChangeLog b/doc/ChangeLog index 0339550..d4eb2a9 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -3,6 +3,9 @@ * ipmaker.py: more informative message when ipy_user_conf import fails (suggest running %upgrade). + * tools/run_ipy_in_profiler.py: Utility to see where + the time during IPython startup is spent. + 2006-12-20 Ville Vainio * 0.7.3 is out - merge all from 0.7.3 branch to trunk diff --git a/tools/run_ipy_in_profiler.py b/tools/run_ipy_in_profiler.py new file mode 100644 index 0000000..bcd0ef7 --- /dev/null +++ b/tools/run_ipy_in_profiler.py @@ -0,0 +1,16 @@ +import cProfile as profile +import sys +#import profile + +def main(): + import IPython.ipapi + print "Entering ipython for profiling. Type 'Exit' for profiler report" + IPython.ipapi.launch_new_instance() + +if len(sys.argv) == 1: + profile.run('main()', 'ipython_profiler_results') + +import pstats +p = pstats.Stats(len(sys.argv) >1 and sys.argv[1] or 'ipython_profiler_results') +p.sort_stats('time').print_stats(30) +