On Feb 1, 2010, at 6:14 PM, Minh Nguyen wrote:

Hi Stefan,

On Tue, Feb 2, 2010 at 1:07 PM, Stefan <[email protected]> wrote:

<SNIP>

Can anyone point me in the right direction for profiling a Python
function in Sage?

Here's an example on using prun from within Sage:

sage: %prun next_prime(10)
        4 function calls in 0.000 CPU seconds

  Ordered by: internal time

  ncalls  tottime  percall  cumtime  percall filename:lineno(function)
       1    0.000    0.000    0.000    0.000 {method 'next_prime' of
'sage.rings.integer.Integer' objects}
       1    0.000    0.000    0.000    0.000 arith.py:772(next_prime)
       1    0.000    0.000    0.000    0.000 <string>:1(<module>)
       1    0.000    0.000    0.000    0.000 {method 'disable' of
'_lsprof.Profiler' objects}


For more information on the command prun(), see its doctring by
issuing the command "prun?".

Note, however, that code passed to prun is not preparsed.

- Robert


--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to