In general we would like to avoid writing doctests that are large only to take a measurable amount of time, but you could look into using cputime() with the first invocation and then making sure the second call is < 0.0x * (first call time).
On Wed, Jan 18, 2012 at 8:05 AM, Michael Orlitzky <mich...@orlitzky.com> wrote: > Is there an existing way to doctest for performance regressions? I have > in mind: > > http://trac.sagemath.org/sage_trac/ticket/12292 > > If I create a big enough matrix, I can make charpoly() take, say, N > seconds. The second call should take around 0 seconds. I would like to > test that 0<N, even when using a new variable name. > > -- > To post to this group, send an email to sage-devel@googlegroups.com > To unsubscribe from this group, send an email to > sage-devel+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/sage-devel > URL: http://www.sagemath.org -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org