Execution time of lines within a function

monkeyboy fsenkel at lynx.neu.edu
Mon Dec 4 13:03:20 EST 2006


The output was from print_callees(). It appears as though print_stats()
and print_callees() return the same data, just in a different
orangization. There is supposed to be a "lineevents=1" option in
hotshot.Profile, for line timings, but it doesn't seem to work in
Python 2.4.

Thanks for your help

Neil Cerutti wrote:
> On 2006-12-04, monkeyboy <fsenkel at lynx.neu.edu> wrote:
> > Thanks Neil,
> >
> > I looked at that, but maybe I don't understand the output. I
> > was hoping to see the cummulative time for the function and
> > then the time associated with each statement (line) within the
> > function.
> >
> > Any suggestions?
>
> I don't think the Python Profiler goes down to that level. The
> next step might be to analyze the function yourself and try to
> understand why it is so slow. Post the code here and let the
> readers pick it apart.
>
> > In the hotshot output below, I can see the function being
> > called 100 times, which is correct, but the rest seems at too
> > low a level for me to understand which statements are causing
> > the slow execution.
>
>
> >
> > hw6r3.py:276(main)                   hw6r3.py:73(findw)(100) 26700.865
> 
> Is this the print_callees output?
> 
> -- 
> Neil Cerutti




More information about the Python-list mailing list