[Tutor] improving speed using and recalling C functions

Danny Yoo dyoo at hashcollision.org
Fri Apr 11 01:55:13 CEST 2014


>    ncalls  tottime  percall  cumtime  percall filename:lineno(function)
>         1  149.479  149.479  199.851  199.851 skymaps5.py:16(mymain)
>  18101000   28.682    0.000   28.682    0.000 {method 'write' of 'file'
objects}
>
>     33044    5.470    0.000    6.444    0.000
interpolate.py:394(_call_linear)
>    230000    2.272    0.000   21.279    0.000 instruments.py:10(kappa)
>    231328    2.120    0.000    2.120    0.000
{numpy.core.multiarray.array}
>     33044    1.719    0.000    3.836    0.000
interpolate.py:454(_check_bounds)
>     66088    1.611    0.000    1.611    0.000 {method 'reduce' of
'numpy.ufunc'
> objects}
>     33044    1.146    0.000   11.623    0.000
interpolate.py:443(_evaluate)
>     33044    1.120    0.000    5.542    0.000 interpolate.py:330(__init__)
>     33044    0.659    0.000    2.329    0.000 polyint.py:82(_set_yi)
>
> the major time is required by mymain that is the whole program.

Good!  Profiles like this allow us to pinpoint issues.

Wait... ?!

The profiler is saying that the majority of time is in my main, but _not_
in auxiliary functions. That's surprising.  Am I misreading the profile?

Can you show what mymain is doing?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20140410/42e8c6ec/attachment.html>


More information about the Tutor mailing list